private void btnsv_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=tubd_data;Data Source=TIMY\SQLEXPRESS"); try { con.Open(); statusStrip1.Text="Connection Succesfull !!!"; SqlCommand cmd = con.CreateCommand(); cmd.CommandText="Insert into must_first [invoice_no], [date], [name], [total], [total_iv] values ('" + invo_no.Text + "','" + bill_datetxt.Text + "','" + txtname.Text + "','" + txttot.Text + "','" + txtvatinclu.Text + "')"; con.Close(); try { cmd.ExecuteNonQuery(); statusStrip1.Text="Record Updated!!!"; } catch(Exception) { statusStrip1.Text="Record Update Error!!!"; } } catch(Exception) { statusStrip1.Text="Connection Fail !!!"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)