数据适配器错误 [英] Error in Data adapter
本文介绍了数据适配器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
以下是我的
代码
Hi
Below is my code for
DataSet ds = new DataSet();
string selectSql = "Items.Description, Items.ItemNo, Items.Qty FROM Items INNER JOIN ItemParent ON Items.DoNumber = ItemParent.DoNumber";
string connectionString = ConfigurationManager.ConnectionStrings["InvoiceConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(connectionString);
SqlDataAdapter da = new SqlDataAdapter(selectSql,conn);
da.Fill(ds,"Items");
PrintGv.DataSource = ds.Tables["Items"];
我在da.Fill(ds,"Items")附近出现错误;为在'',''附近的语法不正确."
你能帮忙吗
谢谢
i am getting error near da.Fill(ds,"Items"); as "Incorrect syntax near '',''."
could you please help
Thanks
推荐答案
SQL查询中的 SELECT 在哪里.使您的SQL查询正确.
Where is SELECT in SQL Query. Make your SQL Query proper.
Use "Select"
Use "Select"
string selectSql = "Select * from login";
//continue ur code
<a href="http://www.java2s.com/Code/SQLServer/Select-Query/CatalogSelect-Query.htm">Refer Sql Queries</a>
<a href="http://www.java2s.com/Code/SQLServer/Select-Query/CatalogSelect-Query.htm">Refer Sql Queries</a>
已经给出了答案,但我建议 [ ^ ]文章以便更好地了解ADO.net最佳实践.
希望能对您有所帮助. :)
As the answer is already given, but I recommend This [^]article to get better understanding of ADO.net best practices.
hope it will help you in future. :)
这篇关于数据适配器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文