读书人

OleDbCommand,该如何解决

发布时间: 2012-03-11 18:15:39 作者: rapoo

OleDbCommand
cmdLine1 = New OleDbCommand( "select起X,起Y from GX order by 管线种类 where 管线种类= ' " & gxzl(j) & " ' ", cn)
rdLine1 = cmdLine1.ExecuteReader
err:未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll 中。
但cmdLine1 = New OleDbCommand( "select起X,起Y from GX order by 管线种类 ", cn)
rdLine1 = cmdLine1.ExecuteReader
却没有错误,什么原因?

[解决办法]
cmdLine1 = New OleDbCommand( "select起X,起Y from GX order by 管线种类 where 管线种类= ' " & gxzl(j) & " ' ", cn)
=====================
cmdLine1 = New OleDbCommand( "select起X,起Y from GX where 管线种类= ' " & gxzl(j) & " ' " & " order by 管线种类 ", cn)

读书人网 >VB Dotnet

热点推荐