Sybase数据库连接到asp.net网页 [英] Sybase database connection to asp.net web page

查看:67
本文介绍了Sybase数据库连接到asp.net网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好....我正在尝试将Sybase数据库连接到我的aspx页面.
将myConnection设置为OdbcConnection
Dim sConnString As String = _
& quot; Driver = {SQL Server};" & amp; _
"服务器= kcncdata;& quot; & amp; _
"数据库= kcncdata;& quot; & amp; _
& quot; Uid = dba;& quot; & amp; _
& quot; Pwd = sql& quot;
myConnection =新的OdbcConnection(sConnString)
myConnection.Open()
点心卷,名称为String
roll = txtroll.Text
名称= txtname.Text
昏暗的myInsertQuery As String =&"INSERT INTO虚拟(rollno,name)值(''roll'',``name'')& quot;
将mycommand调暗为新的OdbcCommand(myInsertQuery)
mycommand.ExecuteNonQuery()
myConnection.Close()

但我遇到以下错误...

错误[08001] [Microsoft] [ODBC SQL Server驱动程序] [DBNETLIB] SQL Server不存在或访问被拒绝.错误[01000] [Microsoft] [ODBC SQL Server驱动程序] [DBNETLIB] ConnectionOpen(Connect()).

hi guys....i am trying to connect my Sybase database to my aspx page..using the code below...

Dim myConnection As OdbcConnection
Dim sConnString As String = _
"Driver={SQL Server};" & _
"Server=kcncdata;" & _
"Database=kcncdata;" & _
"Uid=dba;" & _
"Pwd=sql"
myConnection = New OdbcConnection(sConnString)
myConnection.Open()
Dim roll, name As String
roll = txtroll.Text
name = txtname.Text
Dim myInsertQuery As String = "INSERT INTO dummy (rollno, name) Values(''roll'', ''name'')"
Dim mycommand As New OdbcCommand(myInsertQuery)
mycommand.ExecuteNonQuery()
myConnection.Close()

but i am getting the following error...

"ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect())."

can u help me please to find a solution for the same....?

推荐答案

您使用的连接字符串将不会连接到Sybase数据库SQL Server数据库.

此处看看.< ^ ],用于连接字符串.
The connection string you are using will not connect to a Sybase database it is for a SQL Server database.

Have a look here[^] for connection strings.


这篇关于Sybase数据库连接到asp.net网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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