Object must implement IConvertible.. help..

surlarprensi

New Member
Can somebody help me with this:<BR><BR>I'm just trying to add a hyperlink record on a table using the folowing code, but the mentioned error appears on the debugger.<BR><BR>The code which trigge the error is:<BR><BR> Sub AddNewRecord(Sender As Object, E As EventArgs)<BR> Dim objCommand As OleDbCommand<BR> Dim strSQLQuery As String<BR> Dim myHyperLink As HyperLink = new HyperLink()<BR> ' Our insert command<BR> strSQLQuery = "INSERT INTO tbdownloads " _<BR> & "(NomFich, Enlace, DescF) " _<BR> & "VALUES (@TextValue, @IntValue, @DTValue)"<BR><BR><BR> objCommand = New OleDbCommand(strSQLQuery, objConnection)<BR> <BR> ' Add parameters that our SQL command takes:<BR> objCommand.Parameters.Add(New OleDbParameter("@TextValue", OleDbType.VarChar, 255))<BR> objCommand.Parameters.Add(New OleDbParameter("@IntValue", OleDbType.VarChar, 255))<BR> objCommand.Parameters.Add(New OleDbParameter("@DTValue", OleDbType.VarChar, 255))<BR><BR> myHyperLink.Text = NomFich.value<BR> myHyperLink.NavigateURL = Link.value<BR> <BR> objCommand.Parameters("@TextValue").Value = http://aspmessageboard.com/archive/index.php/NomFich.value<BR> objCommand.Parameters("@IntValue").Value = myHyperLink<BR> objCommand.Parameters("@DTValue").Value = DescF.value<BR><BR> ' Open the connection, execute the command, and close the connection.<BR> objConnection.Open()<BR> objCommand.ExecuteNonQuery()<BR> objConnection.Close()<BR> ShowDataGrid<BR> End Sub<BR>----------------<BR>I think trouble must be in:<BR><BR>Dim myHyperLink As HyperLink = new HyperLink()<BR><BR>Or something...<BR><BR>Any ideas??<BR><BR>Thanks for your time?<BR><BR>Salvador Gallego.I had the same problem. I tracked it down to an invalid value for a parameter. I was setting a value to a StringBuilder object, instead of its ToString property. I found this by drilling down on the connection object in the Locals Window. I looked at the Value property and saw what the problem was. <BR><BR>I solved it changing the method, so i maded my own hyperlink string as you can see in my last post which refers to a parser error that I can't handle and include all this code too with the hiperlynk. Aniway I been modifying the IIS permisions too..<BR><BR>Salvador Gallego.
 
Back
Top