Dim con As SqlClient.SqlConnection Dim cmd As SqlClient.SqlCommand Dim dbname, datasourcename As String Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' DRIVER={SQL Server}; con = New SqlClient.SqlConnection("Data Source=173.236.40.237;Initial Catalog=clickwell_details;User ID=clickwell_user;Password=pwd;") con.Open() cmd = New SqlClient.SqlCommand("insert into tttuser values('" & TextBox1.Text & "','" & TextBox2.Text & "')", con) cmd.ExecuteNonQuery() MsgBox("data inserted") End Sub Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click ' DRIVER={SQL Server}; con = New SqlConnection("Data Source=173.236.40.237;Initial Catalog=clickwell_details;User ID=clickwell_user;Password=pwd") con.Open() cmd = New SqlClient.SqlCommand("create table tttuser ( uname varchar(50),pword varchar(50))", con) cmd.ExecuteNonQuery() MsgBox("Table Created") End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)