hi evryone..
i want to get the text box value to list box .
And also i want this textbox value enter into the dabasex table called Area and @ th esame time insert this value to List box. here is the code wich i have use.
but here DataTable is not filling. Can any1 tell me what is the problem here.
thank you everyone.
i want to get the text box value to list box .
And also i want this textbox value enter into the dabasex table called Area and @ th esame time insert this value to List box. here is the code wich i have use.
Code:
SqlConnection conn = new SqlConnection(ConnectionString);
String S = "Insert into Area values ('" + textBox1.Text.ToString().Trim() + "')";
SqlCommand command = new SqlCommand(S);
SqlDataAdapter da = new SqlDataAdapter(S,ConnectionString);
// DataSet dt = new DataSet();
DataTable dt = new DataTable();
da.Fill(dt);
textBox1.Clear();
listBox1.Items.Add(dt.Rows[0].ItemArray[0].ToString());
thank you everyone.
Comment