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.

Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Apr 9, 2009, 12:44 AM EDT
You can make the non mandatory field as null in database. Now you can pass values to these fields or pass null values.
Steve6 reputationPosted Apr 10, 2009, 8:33 PM EDT
look into Linq with Datasets...create custom classes with names that match the tables of your database, along with column names that match the columns in your table.
then use the DatContext() class to fill in the connection and then follow along with the Linq queries.