Click here to Skip to main content
16,006,001 members
Home / Discussions / C#
   

C#

 
AnswerRe: DirectX app crashing Pin
mav.northwind22-Dec-05 21:56
mav.northwind22-Dec-05 21:56 
GeneralRe: DirectX app crashing Pin
Christian Graus23-Dec-05 11:35
protectorChristian Graus23-Dec-05 11:35 
AnswerRe: DirectX app crashing Pin
leppie23-Dec-05 0:13
leppie23-Dec-05 0:13 
QuestionDelete command with DataSet and DataAdapter Pin
Stefan R22-Dec-05 13:45
Stefan R22-Dec-05 13:45 
AnswerRe: Delete command with DataSet and DataAdapter Pin
Dave Kreskowiak22-Dec-05 15:52
mveDave Kreskowiak22-Dec-05 15:52 
AnswerRe: Delete command with DataSet and DataAdapter Pin
Dave Kreskowiak22-Dec-05 16:14
mveDave Kreskowiak22-Dec-05 16:14 
GeneralRe: Delete command with DataSet and DataAdapter Pin
Stefan R22-Dec-05 22:57
Stefan R22-Dec-05 22:57 
GeneralRe: Delete command with DataSet and DataAdapter Pin
Dave Kreskowiak23-Dec-05 4:24
mveDave Kreskowiak23-Dec-05 4:24 
There's go to be something wrong with your table then. There's no problem with using a DataAdapter with an Access table.

If your table is correct, then you really don't have a need to specify which column is the PK. I've never run into the problem. This code works just fine:

[EDIT]Sorry, wrong language for the forum...[/EDIT]
    string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\TestBlank.mdb"; 
    string sql = "SELECT * From MyTable"; 
 
    OleDbDataAdapter da = new OleDbDataAdapter(sql, connString); 
    OleDbCommandBuilder cb = new OleDbCommandBuilder(da); 
    DataSet ds = new DataSet(); 
 
    da.Fill(ds, "MyTable"); 
 
    foreach (DataRow row in ds.Tables("MyTable").Rows)
    { 
        Debug.WriteLine("ID: " + row("TestID")); 
        row.Delete(); 
    } 
    da.DeleteCommand = cb.GetDeleteCommand(); 
    da.Update(ds, "MyTable");



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome


-- modified at 10:25 Friday 23rd December, 2005
GeneralRe: Delete command with DataSet and DataAdapter - RESOLVED! Pin
Stefan R23-Dec-05 4:41
Stefan R23-Dec-05 4:41 
GeneralRe: Delete command with DataSet and DataAdapter - RESOLVED! Pin
Dave Kreskowiak26-Dec-05 5:53
mveDave Kreskowiak26-Dec-05 5:53 
Question[urgent] web browser, forms Pin
Sam 200622-Dec-05 9:28
Sam 200622-Dec-05 9:28 
QuestionReports in c# Pin
HolyGrandFather22-Dec-05 9:16
HolyGrandFather22-Dec-05 9:16 
AnswerRe: Reports in c# Pin
Christian Graus22-Dec-05 9:45
protectorChristian Graus22-Dec-05 9:45 
AnswerRe: Reports in c# Pin
HakunaMatada22-Dec-05 17:19
HakunaMatada22-Dec-05 17:19 
GeneralRe: Reports in c# Pin
HolyGrandFather22-Dec-05 23:56
HolyGrandFather22-Dec-05 23:56 
GeneralRe: Reports in c# Pin
HakunaMatada23-Dec-05 0:35
HakunaMatada23-Dec-05 0:35 
AnswerRe: Reports in c# Pin
albCode23-Dec-05 0:46
albCode23-Dec-05 0:46 
Questionwhy I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
jerryyag22-Dec-05 8:48
jerryyag22-Dec-05 8:48 
AnswerRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
Stanciu Vlad22-Dec-05 10:12
Stanciu Vlad22-Dec-05 10:12 
AnswerRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
Dave Kreskowiak22-Dec-05 15:40
mveDave Kreskowiak22-Dec-05 15:40 
GeneralRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
jerryyag23-Dec-05 5:37
jerryyag23-Dec-05 5:37 
GeneralRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
Dave Kreskowiak26-Dec-05 5:56
mveDave Kreskowiak26-Dec-05 5:56 
QuestionMSN Options dynamic groupBox Pin
zopiro22-Dec-05 8:44
zopiro22-Dec-05 8:44 
QuestionBreak long line of code into short lines Pin
devinzhang22-Dec-05 8:17
devinzhang22-Dec-05 8:17 
AnswerRe: Break long line of code into short lines Pin
Stanciu Vlad22-Dec-05 10:22
Stanciu Vlad22-Dec-05 10:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.