<asp:Button ID="Button2" runat="server" style="color: #CC66FF" Text="Save Ven Info" Width="91px" onclick="Button2_Click" />
protected void Button2_Click(object sender, EventArgs e) { try { SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Supply Chain ManagementConnectionString3"].ConnectionString); conn.Open(); string insertQuery = "insert into VendorInfo(Name,Address,Email,Phoneno,Faxno) values(@Name,@Address,@Email,@Phoneno,@Faxno)"; SqlCommand Command = new SqlCommand(insertQuery, conn); Command.Parameters.AddWithValue("@Name", TextBox6.Text); Command.Parameters.AddWithValue("@Address", TextBox7.Text); Command.Parameters.AddWithValue("@Email", TextBox8.Text); Command.Parameters.AddWithValue("@Phoneno", TextBox9.Text); Command.Parameters.AddWithValue("@Faxno", TextBox10.Text); Command.ExecuteNonQuery(); //Response.Redirect("Manage Employees.aspx"); Response.Write("Saved"); conn.Close(); } catch (Exception ex) { Response.Write("Data Corrupt" + ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)