'Number'附近的语法不正确 [英] Incorrect Syntax Near 'Number'
本文介绍了'Number'附近的语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个GridView面板,它将显示来自sql数据库的所有数据。
以下是我的代码。
Hi,
I have a GridView panel which will show all the data from sql database.
Below are my code.
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
con.Open();
string all = "select [Board_Name] AS Board, [Platform], [Location], [Status], [CheckOutDate] AS Date, [AssignTo] AS Assigned from Board";
SqlCommand cmd2 = new SqlCommand(all, con);
SqlDataReader result2 = cmd2.ExecuteReader();
GridView1.DataSource = result2;
GridView1.DataBind();
result2.Close();
con1.Close();
调试时,Number'附近的语法不正确消息显示在SqlDataReader result2 = cmd2.ExecuteReader()行;..
愿任何人请回顾并告诉我出了什么问题? :(
While debugging, "Incorrect Syntax Near 'Number'" message are shown at line "SqlDataReader result2 = cmd2.ExecuteReader();"..
May anyone please review and tell me what's wrong? :(
推荐答案
我认为你应该测试连接字符串并查询SQL。
我这样做而不是问题。
I think you should test Connection String and query SQL.
I do it and not problem.
只是重新创建...认为是一些设置问题..
just recreate... think is some setting problem..
这篇关于'Number'附近的语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文