hi
there's an error on my code and i cant figure it out
can someone help me???
conn.Open();
SqlCommand cmd, cmd1, cmd2;
cmd = new SqlCommand("Select choices From selection", conn);
rdr = cmd.ExecuteReader();
while(rdr.Read())
{
if(textBox2.Text.Equals(rdr["choices"]))
{
string insr = @"Insert Router Values("+textBox1.Text+",'"+textBox2.Text+"',null) ";
cmd2 = new SqlCommand(insr, conn);
cmd2.ExecuteNonQuery();
}
else
{
string inss = @"Insert selection Values('"+textBox2.Text+"')";
cmd1 = new SqlCommand(inss, conn);
cmd1.ExecuteNonQuery();
string insr = @"Insert Router Values("+textBox1.Text+",'"+textBox2.Text+"',null) ";
cmd2 = new SqlCommand(insr, conn);
cmd2.ExecuteNonQuery();
}