HELLO Guys, i'm totally new to this_
searched a lot in internet_ but have'nt got the statisfied answer_
actually m trying to send the selected item of comboBox To SQL DB using sql query_
but hv'nt got the success yet_
Here is my code_
private void button1_Click(object sender, EventArgs e)
{
string SQL = "INSERT INTO bca(course,scheme,subcode,subname)VALUES('" + comboBox1.SelectedItem.ToString() + "','" + comboBox2.SelectedItem.ToString() + "','" + textBox1.Text + "','" + textBox2.Text + "')";
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = SQL;
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
MessageBox.Show("success");
}
The texBox data's are saving exactly in the DB, but the comboBox values are saving like System.Data.DataRowView
plzzzz help me to overcome from this__
THanK UUUU