日期:2014-05-18  浏览次数:20379 次

这个错误: cannot be converted to '1-dimensional
错误如下:
BC30311:   Value   of   type   'System.Data.OleDb.OleDbDataReader '   cannot   be   converted   to   '1-dimensional   array   of   System.Data.OleDb.OleDbDataReader '.

Source   Error:
Line   96:   obReader   =   cmd.executeReader   ()

源代码如下:
'显示所选学生其它信息
Sub   ShowOtherInfo(Sender   as   Object,   e   as   EventArgs)
dim   cmd   as   New   OleDbCommand()
dim   conn   As   New     OleDbConnection() 'OleDbConnection()
conn.ConnectionString   =   "Provider=Microsoft.Jet.OLEDB.4.0;   Data   Source   =   "   &   Server.MapPath( "data/qrms.mdb ")  
conn.Open()
cmd.Connection   =   conn
cmd.CommandText   =   "Select   *   from   Chengji   Where   Course   = ' "   &   drpCourse.SelectedItem.text   &   " '   and   XueHao   = ' "   &   drpXuehao.SelectedItem.text   &   " ' "
dim   obReader   as   OleDbDataReader()


obReader   =   cmd.executeReader   ()
while     obReader.read()
names.text   =   obReader.item( "names ")
eScore.text   =   obReader.item( "eScore ")
zScore.text   =     obReader.item( "zScore ")
sScore.text   =   obReader.item( "sScore ")
      Score.text   =   obreader.item( "score ")
end   While
'obReader.close
'conn.close

end   Sub

帮忙看一下,快要交了


------解决方案--------------------
names.text = obReader.GetString(0)