One of my lackings is that I don't know much about the various data types in VB.Net
So I have 2 questions.
The first one's easy... Where can I find a summary of information on VB data types?
The second one is easy too... but it's more wordy...
I have an application that needs to insert a record into an Access table. The table is set up as follows:
Table: NotesHistory
Fields:
Unique_ID - AutoNumber - Long Integer
Type - Text - 50 character
Regarding - Memo
Note_Time - Date/Time - Default Value = Now()
Contact_ID - Number
Record_Manager - Number
Deleted - Yes/No (aka - Boolean) - Default Value = False
When I run my program and try to insert a new row of data, I get the following exception message:
"Data type mismatch in criteria expression."
My insert command is created as follows:
oledbCMD = New OleDbCommand("INSERT INTO NotesHistory (" & _
"Type, " & _
"Regarding, " & _
"Note_Time, " & _
"Contact_ID, " & _
"Record_Manager) " & _
"VALUES (" & _
"@Type, " & _
"@Regarding, " & _
"@Note_Time, " & _
"@Contact_ID, " & _
"@Record_Manager)", oledbConn)
oledbCMD.Parameters.Add("@Type", OleDbType.Char, 50, "Type")
oledbCMD.Parameters.Add("@Regarding", OleDbType.Char, 50, "Regarding")
oledbCMD.Parameters.Add("@Note_Time", OleDbType.DBTimeStamp, 14, "Note_Time")
oledbCMD.Parameters.Add("@Contact_ID", OleDbType.Integer, 32, "Contact_ID")
oledbCMD.Parameters.Add("@Record_Manager", OleDbType.Integer, 32, "Record_Manager")
oledbDA.InsertCommand = oledbCMD
When I look at my TRACE
I see the data I just placed into the DataSet, and it looks right to me...
In Notes/History screen - Type =
CalledIn Notes/History screen - Regarding =
Notes/History Test DataIn Notes/History screen - Note_Time =
4/27/2004 11:10:00 AMIn Notes/History screen - Contact_ID =
10In Notes/History screen - Record_Manager (hardwired for now) =
1In Notes/History New Row - Type =
CalledIn Notes/History New Row - Regarding =
Notes/History Test DataIn Notes/History New Row - Note_Time =
4/27/2004 11:10:00 AMIn Notes/History New Row - Contact_ID =
10In Notes/History New Row - Record_Manager (hardwired to 1 for now) =
1I'm hoping that my field sizes and types are correct but since I don't know much about VB data types, I'm not sure.
Can someone help me get this working?
TIA,
Rick