If the row already exists, then use UPDATE:
. . .
SqlCommand cmd = new SqlCommand("UPDATE tbl_TestingThatSubjects SET [LANGUAGE] = @LANGUAGE WHERE IDNO = @IDNO",
Conn);
. . .
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
how can i do this
sqlcommand cmd= new sqlcommand("INSERT INTO tbl_A (columnA, columnB,
columnC)VALUES (@columnA, @columnB, @columnC)",conn);
cmd.parameter.Addwithvalue ("@columnA", textboxA);
cmd.parameter.ADdwithvalue("@columnB", textboxB);
cmd.ExecuteNonQuery();
is it possible to insert only on two columns when i have more than two columns in my sql table please can some one help me to achieve this.
i tried this code below:
SqlConnection Conn = new SqlConnection(shoolmanangmentconn);
Conn.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO tbl_TestingThatSubjects(INDO, LANGUAGE,BIOLOGY, GEOGRAPHY) VALUES (@IDNO,@LANGUAGE,@BIOLOGY,@GEOGRAPHY)", Conn);
cmd.Parameters.AddWithValue("@IDNO", txtids.Text);
cmd.Parameters.AddWithValue("@LANGUAGE", txtlanguage.Text);
cmd.ExecuteNonQuery();
i am trying to insert into only at column LANGUAGE without inserting into other columns
please can someone teach me how to do the right thing. (am using wpf c#)
If the row already exists, then use UPDATE:
. . .
SqlCommand cmd = new SqlCommand("UPDATE tbl_TestingThatSubjects SET [LANGUAGE] = @LANGUAGE WHERE IDNO = @IDNO",
Conn);
. . .