I need to insert data using dataAdapter. I have using following code. Isthis code iscorrect or nt??
<<<<<<<<<<<<<<<<<<
private void btnSave_Click(object sender, EventArgs e)
{
SqlConnection cn;
string cnstring = "server=(local)\\SQLEXPRESS;Database=Test;Integrated Security=True";
cn = new SqlConnection(cnstring);
string sql;
sql = "insert into Insert1 values('" + txtname.Text + "'," + txtrno.Text + ",'" + txtadd.Text + "','" + cmdgender + "')";
cn.Open();
SqlDataAdapter da = new SqlDataAdapter(sql, cn);
cn.Close();
}
>>>>>>>>>>>>>>>>