问题描述
嗨
我正在编写查询以生成运行时索引列,如下所示:SET @rank = 0 ; SELECT @rank:=@rank+1 AS
否,unm=''abc''
用户的名字
当我复制&时查询运行正常将其粘贴到sqlyog编辑器(我正在使用mysql)
它显示正确的结果.
但是,当我用.NET代码编写相同的查询时,在下面的代码中,它显示错误.可能是'';''的becos
Hi
I am writing a query to generate a runtime index column as follows:SET @rank = 0 ; SELECT @rank:=@rank+1 AS
No,firstname from users where unm=''abc''
The query is running fine when I copy & paste it to sqlyog editor (I am using mysql)
It shows the correct results.
But when i written same query in .NET code and at the movement below code it showing error. It might be becos of '';''
Dataset ds = new Dataset()<br />
MySqlDataAdapter dAdap = new MySqlDataAdapter(SelectQuery, connection);<br />
dAdap.Fill(ds);
还有其他解决方案吗?
如果我想生成运行时索引列并将该列返回到数据集中,是否还有其他解决方案?
谢谢
sjs
Is there any other solution for that.
Is there any other solution if I want to generate runtime index column and return that column into dataset.
Thanks
sjs
推荐答案
allow user variables = true
Check the Connection String .
这篇关于mysqldataadapter不接受;在查询中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!