In die erste Nullreihe einfügenC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 In die erste Nullreihe einfügen

Post by Anonymous »

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.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post