Sqlconnection conn;
Sqlcommand cmd;
conn = new SqlConnection("Server=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database.MDF;Trusted_Connection=True;User Instance=yes");
conn.Open();
string cmdString = "Insert into Customer Detail (Customer_id,Name,Address,Contact_Person,Contact_Person_no)Values ('" + TextBox6.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox5.Text + "','" + TextBox4.Text + "')";
cmd = new SqlCommand(cmdString, conn);
cmd.ExecuteNonQuery();
Label2.Visible = true;
Label2.Text = "Successfully Submitted";
TextBox6.Text = "";
TextBox1.Text = "";
TextBox2.Text = "";
TextBox5.Text = "";
TextBox4.Text = "";
conn.Close();
ashita08 0 Newbie Poster
ashita08 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
sania khan 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.