关于VB.net中定义动态数组并赋值的问题 50
command=NewSqlCommand("select购物车编号from购物车表where用户编码=@userid",conn)command.Parameters....
command = New SqlCommand("select 购物车编号 from 购物车表 where 用户编码 = @userid", conn)
command.Parameters.AddWithValue("@userid", userid)
cartda.SelectCommand = command
cartda.Fill(cartds, "cartnumtable")
cartdt = cartds.Tables("cartnumtable")
Dim cartnum() As DataRow = cartdt.Select()
Dim carnum As Integer = Val(cartnum(0)("购物车编号").ToString())
运行错误提示:索引超出了数组界限,请问最后两行错误在哪,怎么修改,求高手指点 展开
command.Parameters.AddWithValue("@userid", userid)
cartda.SelectCommand = command
cartda.Fill(cartds, "cartnumtable")
cartdt = cartds.Tables("cartnumtable")
Dim cartnum() As DataRow = cartdt.Select()
Dim carnum As Integer = Val(cartnum(0)("购物车编号").ToString())
运行错误提示:索引超出了数组界限,请问最后两行错误在哪,怎么修改,求高手指点 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询