Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
VB.NET
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


Please send the current, I use ASP.NET, SQL server.
Posted
Updated 18-Jun-13 0:43am
v3

1 solution

Hi,

Goto http://connectionstrings.com/[^]

Please make sure you choose the correct sql version, and the security mode.
From your sample code i will say that you use standart security mode.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900