EX:
If I had a table (table1):ID: textJAN: int (null values allowed)FEB: int (null values allowed)MAR: int (null values allowed)
and I wanted to insert the following record into the table
record 1:
idcode: "tim"janvalue: missingfebvalue: 2marvalue: 5
C# codestring idcode;idcode="tim";int janvalue;janvalue = ?;int febvalue;febvalue=2;int marvalue;marvalue=5;
string sqlparam=@"insert into table1(id,jan,feb,mar)values(@ idcode,@janvalue,@febvalue,@marvalue)";
SqlCommand cmd = new SqlCommand(sqlparam, conn);cmd.Parameters.Add("@idcode", SqlDbType.VarChar, 11);cmd.Parameters.Add("@janvalue", SqlDbType.Int);cmd.Parameters.Add("@febvalue", SqlDbType.Int);cmd.Parameters.Add("@marvalue", SqlDbType.Int);try{conn.Open();cmd.Parameters["@blscode"].Value = blscode;cmd.Parameters["@janvalue"].Value = janvalue;cmd.Parameters["@febvalue"].Value = febvalue;cmd.Parameters["@marvalue"].Value = marvalue;}..........