I need some help, cant figure out the error.
I get this error:
Conversion failed when converting the varchar value 'AccNum' to data type int.
I have checked in the database and AccNum is datatype int, and InvStatus datatype varchar, If there's something I'm missing or something else I should check i'd appreciate the help. Thanks
Code:
SqlConnection dbConnection = new SqlConnection(xmldb);
dbConnection.Open();
string sql = "SELECT InvStatus FROM SaleReceipts Where AccNum = '" + lblAccNum.Text + "' ";
SqlCommand command = new SqlCommand(sql, dbConnection);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
InvoiceStatus = reader[0].ToString();
}
reader.Close();
dbConnection.Close();
Conversion failed when converting the varchar value 'AccNum' to data type int.
I have checked in the database and AccNum is datatype int, and InvStatus datatype varchar, If there's something I'm missing or something else I should check i'd appreciate the help. Thanks
Comment