2
Reply

inserting values into mysql db via winforms

sachi vasishta

sachi vasishta

Apr 9 2009 2:33 AM
2.4k

Hi,

I have a winform that contains some controls in which some are mandatory fields and others are not. Now while inserting values into mysql db via forms I dont want to insert "some" values(which are not mandatory) of non mandatory fields .In order to that I know I can write like this:  insert into tablename(col1,col2,col3,....)values(value1,value2,value3) But It is not mandatory that the user should fill all the values for fields which are not mandatory. How to get this??

for example assume there are 4 fields(which are not mandatory) namely sex,marital status,city,hobbies. Now user A fills sex,marital status,city but leaves hobbies field blank. User B fills marital status,hobbies,city and leaves sex field blank.

 


Answers (2)