NicoVB Posted August 27, 2002 Posted August 27, 2002 What are the reasons that a SQL command builder object doesn't build an update statement properly. When I ask the commandtext that it created, it gives whole the string but the parameters don't have any values. So I update nothing. I have a primary key in my initial query: 'SELECT * FROM Table1 WHERE ID = 2' (this is one row) Then I bind all the controls I need to change. When I change one value of and I click on UPDATE. It doesn't do anything, because he doesn't produce values for the parameters in the update query. Any solution?? Quote Visit http://www.nico.gotdns.com Now ONLINE!
Gazzo Posted September 18, 2002 Posted September 18, 2002 Hi, Not sure exactly what you are doing, but if you are binding - for instance text boxes, and you are only editing one record you need to make sure that you finish the edit before trying to update the dataset otherwise the DataRowState property of the DataSet will be DataRowState.Unchanged and the update method will not be called. By calling the EndCurrentEdit() method of the BindingContext if you have made changes to the give DataSet the DataRowState property will be set to DataRowState.Modified, this will then call the update method. e.g. before you call the update method do this: BindingContext(DataSetName, "DataTableName").EndCurrentEdit Good Luck, Gazzo Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.