首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

OleDbCommand,该如何解决

2012-03-11 
OleDbCommandcmdLine1NewOleDbCommand( select起X,起YfromGXorderby管线种类where管线种类&gxzl(j)&

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)

热点排行