I have a web form with a GridView control on it. It has the DataKeyNames property set to "Contact_ID, TStamp". The way the form works is that the form show ALL Contacts whether they are added to the Contact List or not. Then, the user can click a checkbox to have the Contact added to or remove from the Contact List. When the user clicks on Submit, I enumerate through the GridView's rows and check to see if a change was made to the row and if so, I process the change. This could trigger an Insert, Update or Delete to the SQL database.
Inserts are working great. The problem comes when I need to get the TStamp value in the code-behind out of the DataKeys and into the UpdateParameter or DeleteParameter.
ObjectDataSource1.UpdateParameters("TStamp").DefaultValue = GridView1.DataKeys(gvRow.RowIndex)("TStamp") gives me an invalid conversion from byte[] to string. The DefaultValue of the UpdateParameter only takes a string value.
How do I hand it a byte[]?
Thanks in advance!!




Reply With Quote