Insert.docx

  • Uploaded by: Darbar Sejal
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Insert.docx as PDF for free.

More details

  • Words: 75
  • Pages: 1
Protected Sub Insert(ByVal sender As Object, ByVal e As EventArgs) Dim name As String = txtName.Text Dim country As String = txtCountry.Text Dim query As String = "INSERT INTO Customers VALUES(@Name, @Country)" Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString txtName.Text = "" txtCountry.Text = "" Using con As SqlConnection = New SqlConnection(constr) Using cmd As SqlCommand = New SqlCommand(query) cmd.Parameters.AddWithValue("@Name", name) cmd.Parameters.AddWithValue("@Country", country) cmd.Connection = con con.Open() cmd.ExecuteNonQuery() con.Close() End Using End Using

Me.BindGrid() End Sub

More Documents from "Darbar Sejal"