| | |
SQL UPDATE Error
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 28
Reputation:
Solved Threads: 0
Hi
I have the following code which generates an error 'Data Type mismatch in criteria expression'
The purpose of the code is to write a value to a database at a specific row.
I have the following code which generates an error 'Data Type mismatch in criteria expression'
The purpose of the code is to write a value to a database at a specific row.
VB.NET Syntax (Toggle Plain Text)
Dim IntSid As String Dim Sid As String Dim I As Integer IntSid = Me.TTIn.Text Sid = Me.SessionIDTextBox.Text I = CInt(Val(Sid)) Dim loSQL = "UPDATE tblSession SET TTout = '" & _ IntSid & "' WHERE SessionId = '" & _ I & " ' "
•
•
Join Date: Jun 2007
Posts: 28
Reputation:
Solved Threads: 0
Hi
I got it to work the problem was the single quote around the variable I which is an Integer and not a String
My original SQL statement was
This should have been
ViRi
I got it to work the problem was the single quote around the variable I which is an Integer and not a String
My original SQL statement was
VB.NET Syntax (Toggle Plain Text)
Dim loSQL = "UPDATE tblSession SET TTout = '" & _ IntSid & "' WHERE SessionId = '" & _ I & " ' "
This should have been
VB.NET Syntax (Toggle Plain Text)
Dim loSQL = "UPDATE tblSession SET TTout = '" & _ Me.TTIn.Text & "'WHERE SessionId = " & _ I & " "
ViRi
![]() |
Similar Threads
- automatic update error?? (Windows NT / 2000 / XP)
- windows update error (Windows NT / 2000 / XP)
- $rs=mysql_query($sql) or die("error in common.inc.php at line 257"); (PHP)
- ADO.Net SQL UPDATE using OleDBAdapter (C#)
- SQL server error: 18452 - connection to SQL error (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: load data from access database into form
- Next Thread: Doubt
Views: 1539 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database databasesearch datagrid datagridview design designer dissertation dissertations dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy highlighting images inline insert installer intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting studio syntax table tcp text textbox time timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






