C
Chris Thunell
I have a memory stream that i would like to save to an sql2000 database and
then retreave it later on. I currently have the field set as an sql2000 ->
VarBinary type of field. Any suggestions in vb.net??? When i run the
current code i get an: "An unhandled exception of type
'System.InvalidCastException' occurred in system.data.dll - Additional
information: Object must implement IConvertible" error.
Dim Str As New System.IO.MemoryStream
GridView1.SaveLayoutToStream(Str)
Str.Seek(0, System.IO.SeekOrigin.Begin)
Dim myRow As DataRow
Me.daPGMGridViews.Fill(Me.DataSet11.tblPgmGridViews)
If Me.DataSet11.tblPgmGridViews.Rows.Count = 0 Then
myRow = Me.DataSet11.tblPgmGridViews.NewRow
myRow("GridViewBinary") = Str
Me.DataSet11.tblPgmGridViews.Rows.Add(myRow)
Else
myRow = Me.DataSet11.tblPgmGridViews.Rows(0)
myRow("GridViewBinary") = Str
End If
Me.daPGMGridViews.Update(Me.DataSet11.tblPgmGridViews)
Thanks for your help!
Chris Thunell
(e-mail address removed)
then retreave it later on. I currently have the field set as an sql2000 ->
VarBinary type of field. Any suggestions in vb.net??? When i run the
current code i get an: "An unhandled exception of type
'System.InvalidCastException' occurred in system.data.dll - Additional
information: Object must implement IConvertible" error.
Dim Str As New System.IO.MemoryStream
GridView1.SaveLayoutToStream(Str)
Str.Seek(0, System.IO.SeekOrigin.Begin)
Dim myRow As DataRow
Me.daPGMGridViews.Fill(Me.DataSet11.tblPgmGridViews)
If Me.DataSet11.tblPgmGridViews.Rows.Count = 0 Then
myRow = Me.DataSet11.tblPgmGridViews.NewRow
myRow("GridViewBinary") = Str
Me.DataSet11.tblPgmGridViews.Rows.Add(myRow)
Else
myRow = Me.DataSet11.tblPgmGridViews.Rows(0)
myRow("GridViewBinary") = Str
End If
Me.daPGMGridViews.Update(Me.DataSet11.tblPgmGridViews)
Thanks for your help!
Chris Thunell
(e-mail address removed)