我需要Currect Connection String才能访问我的在线数据库 [英] I need Currect Connection String to access my online DB

查看:78
本文介绍了我需要Currect Connection String才能访问我的在线数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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





请发送当前,我使用ASP.NET,SQL服务器。



Please send the current, I use ASP.NET, SQL server.

推荐答案





转到 http://connectionstrings.com/ [ ^ ]



请确保选择c正确的sql版本和安全模式。

从你的示例代码我会说你使用标准安全模式。
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.


这篇关于我需要Currect Connection String才能访问我的在线数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆