您的位置:首页 > 移动开发 > Objective-C

Object reference not set to an instance of an object

2007-08-01 09:12 621 查看
+ ex {"Object reference not set to an instance of an object."} System.Exception

Solution:
Dim command As New SqlCommand()
Dim hash As New Hashtable
SelectControl.Items.Clear()
Try
hash = ExecuteReader("PRZ3_GetTable", command)
Dim i As Int32
For i = 0 To hash.Count - 1 Step 1
SelectControl.Items.Add(CType(hash(i), ListItem))
Next
SelectControl.DataBind()
Catch ex As Exception
Response.Write(ex.Message)
End Try

因为我For i = 0 To hash.Count -1Step 1原来是For i = 0 To hash.Count Step 1,多了一项
索引是从开始的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐