[求助]怎么把表你的某一条记录读出来????????
出现这个错误..............
由于符号不匹配或数据溢出以外的其他原因,未能转换数据值。例如,数据在数据存储区中已损坏,但该行仍可以检索。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.InvalidCastException: 由于符号不匹配或数据溢出以外的其他原因,未能转换数据值。例如,数据在数据存储区中已损坏,但该行仍可以检索。
源错误:
行 243: reader2.Read()
行 244: 'If reader2.Read = True Then
行 245: a1 = reader2.GetInt32(3)
行 246: a2 = reader2.GetInt32(5)
行 247: a3 = reader2.GetInt32(7)
我的代码是这样的!
Dim conn0 As OleDbConnection
Dim conStr0 As String
Dim reader2 As OleDbDataReader
conStr0 = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("data\data.mdb")
conn0 = New OleDbConnection(conStr0)
Dim comm0 As OleDbCommand
Dim comStr0 As String
comStr0 = "select * from 考试试卷表 where 试卷名称='" + Label24.Text + "'"
comm0 = New OleDbCommand(comStr0, conn0)
Dim da0 As New OleDbDataAdapter
Dim ds0 As New DataSet
da0.SelectCommand = comm0
conn0.Open()
reader2 = comm0.ExecuteReader
reader2.Read()
a1 = reader2.GetInt32(3)
a2 = reader2.GetInt32(5)
a3 = reader2.GetInt32(7)
a4 = reader2.GetInt32(9)
a5 = reader2.GetInt32(11)
Dim conStr0 As String
Dim reader2 As OleDbDataReader
conStr0 = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("data\data.mdb")
conn0 = New OleDbConnection(conStr0)
Dim comm0 As OleDbCommand
Dim comStr0 As String
comStr0 = "select * from 考试试卷表 where 试卷名称='" + Label24.Text + "'"
comm0 = New OleDbCommand(comStr0, conn0)
Dim da0 As New OleDbDataAdapter
Dim ds0 As New DataSet
da0.SelectCommand = comm0
conn0.Open()
reader2 = comm0.ExecuteReader
reader2.Read()
a1 = reader2.GetInt32(3)
a2 = reader2.GetInt32(5)
a3 = reader2.GetInt32(7)
a4 = reader2.GetInt32(9)
a5 = reader2.GetInt32(11)