why can't update database
this code is work (can update my database)
VB Code:
Dim dt = DataSet11.Tables("Customer")
dt.Rows(myMgr.Position)("CustomerPersonalID") = [COLOR=Red]1234567890[/COLOR]
OleDbDataAdapter1.Update(DataSet11, "Customer")
DataSet11.AcceptChanges()
but this code can't update my database
VB Code:
Dim dt = DataSet11.Tables("Customer")
dt.Rows(myMgr.Position)("CustomerPersonalID") = [COLOR=Red]txtCustomerPersonalID.Text[/COLOR]
OleDbDataAdapter1.Update(DataSet11, "Customer")
DataSet11.AcceptChanges()
was i do wrong ?
thanks!
Re: why can't update database
1234567890 is a number. txtCustomerPersonalID.Text is a string. If the second represents a number then it may be implicitly converted, although I wouldn't count on it. If it doesn't represent a number then it definitely won't work.
Re: why can't update database
how to resloved this problem ?
i'm .net newbie
Re: why can't update database
Validate the contents of the TextBox and convert it to a number.
Re: why can't update database
If you're using VB 2005 look up the Integer.TryParse method. If it's an earlier version look up the Double.TryParse method
Re: why can't update database
sometime my data can use char ex: A0137521
is anyway to dt.Rows(myMgr.Position)("CustomerPersonalID") = String
thanks!
ekkapop