In die erste Nullreihe einfügen

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: In die erste Nullreihe einfügen

by Anonymous » 14 Apr 2025, 17:27

Ich versuche, den Wert bei der ersten Null-Spalte hinzuzufügen.

Code: Select all

SqlCommand cmd = my_con.CreateCommand();
cmd.CommandText = "insert into Contents(General_Exam) values(@CC)";
cmd.Parameters.AddWithValue("@CC", txtAddOption.Text);
cmd.ExecuteNonQuery();
comboBoxAddOption.Items.Add(txtAddOption.Text);
SqlCommand cmd1 = new SqlCommand("update TOP(1) Contents SET General_Exam=@CC where General_Exam IS NULL", my_con);
cmd1.Parameters.AddWithValue("@CC", txtAddOption.Text);
cmd1.ExecuteNonQuery();
Aber wenn ich den Wert einfügte, kann er nicht in die erste Null -Zeile einfügen, anstatt dass sie in die letzte Null -Reihe eingefügt wird.>

Top