急!!!!!
Public ADOcmd As OleDbDataAdapterPublic ds As DataSet = New DataSet
Public mytable As Data.DataTable
Public myrow As DataRow
Public rownumber As Integer
Public SearchSQL As String
Public cmd As OleDbCommandBuilder
Public Function ExecuteSQL(ByVal SQL As String, ByVal table As String)
ADOcmd = New OleDbDataAdapter(SQL, "provider=microsoft.jet.oledb.4.0;data source=D:\vb.net\09\db1.mdb")
ds.Clear()
ADOcmd.Fill(ds, table)
mytable = ds.Tables.Item(0)
rownumber = 0
myrow = mytable.Rows.Item(rownumber) a = myrow.Item(0)
End Function
Dim tablename As String
tablename = "lendinfo"
SearchSQL = "SELECT * FROM lendinfo where (userid='" & TextBox1.Text & "')"
ExecuteSQL(SearchSQL, tablename)
程序运行到myrow = mytable.Rows.Item(rownumber)的时候就提示位置0处无任何行
要是用我的登录表userid就能过去,换别的表就提示错误,为什么啊????急啊!!!!!! --------------------编程问答-------------------- 如果mytable.Rows.Item的Length是0的话,会产生这样的问题。 --------------------编程问答-------------------- 是只有登录表userid有数据,其他表没数据? --------------------编程问答-------------------- mytable.Rows.Item的Length等于0的话 当然会出错,就是这个表里面没有数据 --------------------编程问答-------------------- 没有数据当然会这样子啦,楼主应该先判断一下表中有没有数据再来赋值 --------------------编程问答-------------------- 应该是你用的表有问题吧,根据报错提示慢慢的调吧~ --------------------编程问答-------------------- --------------------编程问答-------------------- 请问你的fckeditor问题解决了么 --------------------编程问答-------------------- 我的表里有数据啊,可是都不好用啊,只有登录的那个好用 --------------------编程问答-------------------- 我的问题还没解决啊,哪个好心的再帮帮忙啊
补充:.NET技术 , VB.NET