TableAdapter.Update("new column values", "original column values")

Behrooz

Member
Joined
Feb 8, 2007
Messages
15
Programming Experience
5-10
TableAdapter.Update("new column values", "original column values")

Hello everey1
How can I use this format of update method in ado.net 2. I have some problems with the original column values. I have defined two columns : 1. id (as integer) /2. desc(as string)/ but in runtime this method make an error that Update method can not convert the id column to string. My update code is as bellow:
Me.myTableAdapter.Update(Val(Me.txtID.Text), Me.txtDesc.Text, "ID", "Desc")
I already have read the http://msdn2.microsoft.com/en-us/library/ms233819(VS.80).aspx
Can u F1 me?!!!!
icon5.gif
 
I`ve done that

Oh, thats great :
I used this kind of update method in tableadapter as this bellow and it was successfull:
Me.myTableAdapter.Update(Val(Me.txtID.Text),"ID", Me.txtDesc.Text, "Desc")
and then with this statement I put the base update method as bellow:
Me.myTableAdapter.Update(Me.myDataSet.OwnersTable)
This is almost great for those forms wich the text boxes binding source is set to "None". and you can manually use the textboxes values to update your dataset.
u can see http://msdn2.microsoft.com/en-us/library/ms233819(VS.80).aspx
 
Hello everey1
How can I use this format of update method in ado.net 2

Ive never seen an .Update method of that signature. Normally, for an update statement of:

UPDATE table SET col1 = :param1, col2 = :param2 WHERE id = :id


Update() takes the form:

Update(param1, param2, id)


But then only if GenerateDBDirectMethods is true for the tableadapter
 
Back
Top