ASP.Net VB数据库连接问题

时间:2015-10-29 09:47:41

标签: sql asp.net database dbconnection

我有以下代码连接到我的小型SQL数据库:

<% dbConnect.ConnectionString = "Provider=SQLOLEDB; 
Data Source=db597845552.db.1and1.com; 
Initial Catalog=db597845552; 
User ID=dbo597845552; 
Password=passwordxxd" %>

以下是从数据库中提取名称

<%

dbAD.SelectCommand = New OleDbCommand("SELECT * FROM Employees ORDER BY firstName ASC", dbConnect)
dbAD.Fill(dbRS, "employees")
If dbRS.Tables("employees").Rows.Count > 0 Then
For Each employee As DataRow In dbRS.Tables("employees").Rows
    Response.Write("Employee: " & employee("firstName") & " " & employee("surName") & "<br />")
Next
End If

%>

然而,该页面会显示错误消息:

&#34; System.Data.OleDb.OleDbException:无法比较或排序text,ntext和image数据类型,除非使用IS NULL或LIKE运算符。&#34;

任何人都可以帮助我在这里做错了吗?

提前致谢!

0 个答案:

没有答案