I will like to pass the Empty Textbox to Access Database (Data Type: Number) but it show error (Data type mismatch in criteria expression.)
Code below was used:
oleDBCommand.CommandText =
"INSERT INTO tblRoutineChemAnalData ([Sample1 Vol]) VALUES (@Sample1Vol)";
oleDBCommand.Parameters.Add(new OleDbParameter("@Sample1Vol", textBoxSample1.Text));
Note 1: If Access database field's Data Type set to Short Text / Long Text, code was running fine if the textboxSample1 was empty.
Note 2: If Access database field's Data Type set to Number (Double), code was running error if the textboxSample1 was empty. Error description,
Data type mismatch in criteria expression.
May I know what is the method to pass the empty textbox to Access Database that having Number (double) as Data Type?