Click here to Skip to main content
15,889,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Every buddy

i have a form for insert data to access data base , but data command dont let me send NULL value , i want send some NULL



com.CommandText = "Insert into shenasname VALUES (@ID_sabt ,@name_dam )"
paramss()
com.ExecuteNonQuery()

i insert data with this way , but i cant send null value , for example i want send just ID_sabt Value and send NULL for Name_dam .

Thank you
Posted
Updated 10-Nov-11 2:13am
v2
Comments
OriginalGriff 10-Nov-11 8:03am    
What code are you using?
Use the "Improve question" widget to edit your question and provide better information.
Amol_27101982, India 10-Nov-11 8:08am    
I hope you have marked that field as Allow NULL in the database.

~Amol
synctor 10-Nov-11 8:15am    
i dont see any allow NULL option in Access Data base ! but i choose "NO" For "Require" Option

1 solution

Hello Dear,
Use null constraint as default value for table fields.

Create table tbl(id int, name varchar(100) default null)
above code work in sql server v.*.

see your syntax in ms access db.

Thanks.
 
Share this answer
 
Comments
synctor 10-Nov-11 8:33am    
thank you Very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900