ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  ASP.NET Data Controls Part 1: DataGrids
Subject:   Works Gr8 Gud article - Infact Getting Small error
Date:   2005-03-24 22:50:59
From:   MulapalliPrasad
Every thing works fine , But when i click on update i am getting error saying DATA TYPE MISMATCH.... please help me in this regard.


I've checked the data types at the back end .. they are absolutely fine as per my vision.


thanks in advance.
Prasad


Here goes my code.


Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='E:\lakshmi\jobs\jobs.mdb';"


Dim MySQL As String = "UPDATE usermaster SET username='" & _
username & "' , phone='" & CInt(phone) & _
"' WHERE userid='" & userid & "'"


Dim MyConn As New OleDbConnection(strConn)


Dim Cmd As New OleDbCommand(MySQL, MyConn)
Dim Usercount As Integer
MyConn.Open()


Cmd.ExecuteNonQuery()
MyConn.Close()


DataGrid1.EditItemIndex = -1
Load_Data()
End Sub