[RESOLVED] Can't add integer to database
Hello, I'm trying to add some values to database the code below can't do that:
VB.NET Code:
insert.Parameters.Add("is86", DbType.Int32, 4, list[1]);
I'm not getting any errors. I tried Convert.ToInt32 and int.Parse but didn't work. Can anyone hellp me?
Re: Can't add integer to database
What does the SQL side look like?
-tg
Re: Can't add integer to database
It adds strings but not integers. Heres the query:
VB.NET Code:
SQLiteCommand insert = new SQLiteCommand(
"INSERT INTO tbl_programs " +
"(int_isSelected, txt_programName, int_is86, int_is64, " +
"txt_preCommand, txt_preSwitch, txt_executable, " +
"txt_switches, int_timeout, txt_md5, txt_version, " +
"txt_description, txt_category, dt_insertDate) " +
"VALUES(" +
":isSelected, :programName, :is86, :is64, :preCommand, " +
":preSwitch, :executable, :switches, :timeout, " +
":md5, :version, :description, :category, :insertDate);",
m_dbConnection);
Re: Can't add integer to database
I take it the other fields work OK?
Have you looked to see that list(1) is a number?
-tg
Re: Can't add integer to database
list[1] is empty. How can I get text from combobox properly?