I am trying to add the value at first null column.This is my code-
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();
But when I am inserting value it not inserting in first null row instead of that it get inserted into last null row.I think this happen because Top(1) taking top row.But I want to insert into first null row any one have idea how I able to do that Please tell! Thanks in Advanced.