4
Answers

error message "The field can not be an empty string"

hello all I add a text field connected with the database Access but when I leave a blank text field and stores it in the database shows me an error.
 
 
 
how to solve it knowing that in the database accepts the empty value? 
Answers (4)
0
Ravi Kumar

Ravi Kumar

NA 1.4k 16.8k 9y
hi
in that text box leave function
you give condition
 
if(textbox1.text!=string.empty) 
{
 //code
else
// show message enter the data
 
0
abdelwaheb ammar

abdelwaheb ammar

NA 210 25.7k 9y
ooooooouuuuupssssssssss. i comment the exception and execute it but it make me the same problem
 
 
 
 
 
??????? 
0
abdelwaheb ammar

abdelwaheb ammar

NA 210 25.7k 9y

Attachment codesource.rar

yes i make this code with exception
0
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 9y
You are encountering the exception due to following reason:
 
When you are not providing any value to textbox and submitting database, it is checking the column is mandatory in your database. If you don't want to make mandatory then go to table schema and change not null property.