
April 25th, 2003, 02:24 AM
|
|
Registered User
|
|
Join Date: Apr 2003
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Yes. The dataset is disconnected record. If u delete the record from dataset then it's temporarily deleted. It wont effect your database record. <br><br>Unless u commit to database, such as using Sqlcommand or use SqlCommandBuilder<br>I am not a VB programmer, so I will show you the C# does.<br><br>1. use sqlcommand<br>SqlConnection con;<br>SqlCommand cmd;<br>string DeleteSQL;<br>DeleteSQL = "DELETE authors WHERE au_id = '123';<br>con = new SqlConnection("Server=localhost;Database=pubs;uid=xxx;pwd=xxx");<br>cmd = new SqlCommand(DeleteSQL, con);<br>con.Open();<br>cmd.ExecuteNonQuery();<br><br>2. SqlCommandBuilder<br>SqlCommandBuilder objCB= New SqlClient.SqlCommandBuilder(yourSQLDataAdapter)<br>yourSQLDataAdapter.Update(yourDataSet)<br><br>Hope this help
|