用户代码未处理 System.Data.SqlClient.SqlException 列名‘如背包’无效
我的代码是Dimstrconn2AsStringstrconn2="Server=PC-201001281628\SQLEXPRESS;initialcatalog=sh...
我的代码是Dim strconn2 As String
strconn2 = "Server=PC-201001281628\SQLEXPRESS;initial catalog=shop;user id=sa;password=hzp7416635"
Dim conn2 As SqlConnection = New SqlConnection(strconn2)
Dim cmd2 As New SqlCommand
cmd2.Connection = conn2
cmd2.CommandText = "select Products.ProductName,Products.Description,Products.UnitPrice, Products.ImageURL from Products,ProductCategories,liexing where Products.ProductID=ProductCategories.ProductID and ProductCategories.liexingID=liexing.liexingID and liexingname=" & Request.QueryString("liexingname")
conn2.Open()
Dim dr2 As SqlDataReader = cmd2.ExecuteReader()
DataList2.DataSource = dr2
DataList2.DataBind()
conn2.Close()背包是Request.QueryString("liexingname")中的liexingname哪位能帮下我 展开
strconn2 = "Server=PC-201001281628\SQLEXPRESS;initial catalog=shop;user id=sa;password=hzp7416635"
Dim conn2 As SqlConnection = New SqlConnection(strconn2)
Dim cmd2 As New SqlCommand
cmd2.Connection = conn2
cmd2.CommandText = "select Products.ProductName,Products.Description,Products.UnitPrice, Products.ImageURL from Products,ProductCategories,liexing where Products.ProductID=ProductCategories.ProductID and ProductCategories.liexingID=liexing.liexingID and liexingname=" & Request.QueryString("liexingname")
conn2.Open()
Dim dr2 As SqlDataReader = cmd2.ExecuteReader()
DataList2.DataSource = dr2
DataList2.DataBind()
conn2.Close()背包是Request.QueryString("liexingname")中的liexingname哪位能帮下我 展开
2013-10-20
展开全部
在Dim dr2 As SqlDataReader = cmd2.ExecuteReader() 处设断点(F9)按F5运行,停下来后将鼠标停留在cmd2.CommandText 上(或在cmd2.CommandText 上点击右键->快速查看)查看cmd2.CommandText 的值你就知道是如何错了的了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-10-20
展开全部
背包啊,还是 如背包
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询