Hi,
I'm new to C sharp and currently writing a small program that uses an Access 2003
database.
I am currently having a problem when updating a row that includes numeric data.
When updating just the text fields in the row everything works fine with the
following command:
dbCommand.CommandText = "UPDATE ScanLibTable SET Regex = '" +
txtRegex.Text.ToString () + "', Description = '" +
txtDescription.Text.ToString () + "' WHERE Key = " +
intCurrentKey.ToString () + ";" ;
but when attempting to also update a numeric field with the index value from a
drop down list I get an except because the UPDATE command is invalid:
int intLang = lstLanguage.SelectedIndex;
dbCommand.CommandText = "UPDATE ScanLibTable SET Regex = '" +
txtRegex.Text.ToString () + "', Description = '" +
txtDescription.Text.ToString () + "', Language = " +
intLang.ToString() + " WHERE Key = " + intCurrentKey.ToString () + ";" ;
Can someone point out what I'm doing wrong?
Cheers
--
----------------------------------------------
Posted with NewsLeecher v3.0 Final
* Binary Usenet Leeching Made Easy
*
http://www.newsleecher.com/?usenet
----------------------------------------------