1
Answer

c# Database file Update

idan hen

idan hen

17y
2.7k
1
I have a lil problem , maybe someone here can help me ? i have an access database called "UserDetails". I can Write to it , i can read from it , all is good . now i wana Update some fields in it , maybe even a full row , i dont really mind . so my code goes like this : [QUOTE] string stAccessConn = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=TestDriveDatabase.mdb"; OleDbConnection DBconn = new OleDbConnection(stAccessConn); OleDbCommand MyAccessCommand = new OleDbCommand(stAccessSelect, DBconn); OleDbDataAdapter MyDataAdapter = new OleDbDataAdapter(MyAccessCommand); DBconn.Open(); DataSet myds = new DataSet(); MyDataAdapter.Fill(myds, "UserDetails"); myds.Tables[0].Rows[1]["FirstName"] = "fuckit"; OleDbCommandBuilder mybuilder = new OleDbCommandBuilder(MyDataAdapter); MyDataAdapter.Update(myds.Tables[0]); DBconn.Close(); [/QUOTE] it looks like it all works , yet the file wont change !! :( anyone ??
Answers (1)