Click here to Skip to main content
15,906,626 members
Home / Discussions / C#
   

C#

 
AnswerRe: WebService Pin
Dave Kreskowiak22-Dec-05 17:59
mveDave Kreskowiak22-Dec-05 17:59 
GeneralRe: WebService Pin
flysky61822-Dec-05 20:11
flysky61822-Dec-05 20:11 
GeneralRe: WebService Pin
Dave Kreskowiak23-Dec-05 3:52
mveDave Kreskowiak23-Dec-05 3:52 
QuestionDirectX app crashing Pin
Christian Graus22-Dec-05 16:18
protectorChristian Graus22-Dec-05 16:18 
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 
Good evening ( although it's night time in Sweden)
I'm trying to delete all my records in a single table with a DataAdapter. The code I use is this:
odbAdapter = new OleDbDataAdapter();<br />
			odbAdapter.SelectCommand = new OleDbCommand("Select * from Bilder", odbConnection);<br />
			OleDbCommandBuilder cb = new OleDbCommandBuilder(odbAdapter);<br />
			<br />
			odbConnection.Open();<br />
			odbAdapter.Fill(ds, "Bilder");<br />
<br />
			DataTable dt = ds.Tables["Bilder"];<br />
			<br />
			DataRow[] dr = dt.Select();<br />
		<br />
			foreach(DataRow item in dr)<br />
			{<br />
				item.Delete();<br />
			}<br />
			<br />
			odbAdapter.DeleteCommand = cb.GetDeleteCommand();<br />
			odbAdapter.Update(ds,"Bilder");<br />

However, I get an error message saying :

Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information

I'm guessing this has something to do with a primary key or something, judging by info gathered at other places. The primary key in the table is not automatically generated or anything. What the heck am i doing wrong here?
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 
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 &amp;quot;Collection was modified; enumeration operation may not execute.&amp;quot; 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 &amp;amp;quot;Collection was modified; enumeration operation may not execute.&amp;amp;quot; 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 &amp;amp;quot;Collection was modified; enumeration operation may not execute.&amp;amp;quot; 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 &amp;amp;amp;quot;Collection was modified; enumeration operation may not execute.&amp;amp;amp;quot; Pin
jerryyag23-Dec-05 5:37
jerryyag23-Dec-05 5:37 

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.