Imports System.Data
Imports System.Data.SqlClient
Public Class Form2
Dim myconnection As SqlConnection
Dim mycommand As SqlCommand
Dim dr As SqlDataReader
Dim dr1 As SqlDataReader
Dim ra As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
myconnection = New SqlConnection("server=Pakistan;Initial Catalog=Mumtaz;database=Mumtaz")
myconnection.Open()
mycommand = New SqlCommand("insert into temp([name],[datep]) values ('" & TextBox1.Text & "','" & TextBox2.Text & "')", myconnection)
mycommand.ExecuteNonQuery()
'MessageBox.Show("New Row Inserted" & ra)
myconnection.Close()
End Sub
End Class