Click here to Skip to main content
15,891,567 members
Home / Discussions / Database
   

Database

 
GeneralRe: "Specified cast is not allowed" calling DataAdapter.Fill Pin
Aryadip12-May-04 0:26
Aryadip12-May-04 0:26 
GeneralRe: "Specified cast is not allowed" calling DataAdapter.Fill Pin
vSoares12-May-04 0:52
professionalvSoares12-May-04 0:52 
GeneralDTS Problem : Insertion of failed records Pin
KSEI6-May-04 23:01
KSEI6-May-04 23:01 
GeneralRe: DTS Problem : Insertion of failed records Pin
RichardGrimmer7-May-04 0:48
RichardGrimmer7-May-04 0:48 
GeneralProvide progress during lenghty stored procedure Pin
Froefel6-May-04 21:17
Froefel6-May-04 21:17 
GeneralClickety Pin
Colin Angus Mackay6-May-04 23:58
Colin Angus Mackay6-May-04 23:58 
GeneralNeed help importing data Pin
Anonymous6-May-04 8:39
Anonymous6-May-04 8:39 
GeneralDeleting all record from Database Table with ADO.NET Pin
Gary Hyslop6-May-04 4:06
Gary Hyslop6-May-04 4:06 
I am writing a utility which will delete all existing records in a table and then add new records using ADO.NET (and C#). I define a Data Table with the same schema as the database table and then use the SqlDataAdaper Update method to add rows to the database table. This works fine if I first delete all the rows from the database table using the SQL Server 2000 Query Analyzer. I simply use the statement "DELETE FROM ". I wish to add code that will do this as a preliminary to repopulation. I have created an SqlDeleteCommand and set its Command Text to "DELETE FROM
". Then I set the DeleteCommand property of the SqlDataAdapter object to this object. I then call the adapter's Update method passing it a DataTable with the same schema as the database table but with 0 rows. It is my understanding that the Update method would attempt to reconcile the differences between DataTable and database table by calling invoking the SQL Delete statement. This does not happen. Can anyone help me clean the rows out of the database table programmatically?

Gary A Hyslop

GeneralRe: Deleting all record from Database Table with ADO.NET Pin
Mazdak6-May-04 6:47
Mazdak6-May-04 6:47 
GeneralRe: Deleting all record from Database Table with ADO.NET Pin
Chris Meech6-May-04 9:17
Chris Meech6-May-04 9:17 
GeneralRe: Deleting all record from Database Table with ADO.NET Pin
Guillermo Rivero6-May-04 10:05
Guillermo Rivero6-May-04 10:05 
GeneralRe: Deleting all record from Database Table with ADO.NET Pin
-Dr_X-8-May-04 15:50
-Dr_X-8-May-04 15:50 
QuestionMs Access Problem? Pin
catztay5-May-04 13:39
catztay5-May-04 13:39 
AnswerRe: Ms Access Problem? Pin
Roger Wright5-May-04 15:07
professionalRoger Wright5-May-04 15:07 
GeneralInner Join (JOY!) and Datasets Pin
Tristan Rhodes5-May-04 12:46
Tristan Rhodes5-May-04 12:46 
GeneralRe: Inner Join (JOY!) and Datasets Pin
Edbert P5-May-04 13:04
Edbert P5-May-04 13:04 
GeneralRe: Inner Join (JOY!) and Datasets Pin
Tristan Rhodes6-May-04 6:32
Tristan Rhodes6-May-04 6:32 
GeneralRe: Inner Join (JOY!) and Datasets Pin
Edbert P9-May-04 12:24
Edbert P9-May-04 12:24 
GeneralOracle SQL Pin
pankajdaga5-May-04 11:51
pankajdaga5-May-04 11:51 
GeneralRe: Oracle SQL Pin
Mike Ellison6-May-04 5:33
Mike Ellison6-May-04 5:33 
GeneralRe: Oracle SQL Pin
WoutL13-May-04 0:45
WoutL13-May-04 0:45 
GeneralEncrypting Data Pin
MKlucher5-May-04 6:55
MKlucher5-May-04 6:55 
GeneralRe: Encrypting Data Pin
Mazdak5-May-04 7:33
Mazdak5-May-04 7:33 
GeneralRe: Encrypting Data Pin
MKlucher5-May-04 7:38
MKlucher5-May-04 7:38 
GeneralRe: Encrypting Data Pin
Mazdak5-May-04 7:47
Mazdak5-May-04 7:47 

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.