-- 作者:overseaair
-- 发布时间:8/22/2006 11:07:00 AM
-- 菜鸟求助
我在做DataGrid试验的时候,总是出错,实在搞不懂,请教各位, 第 1 行: ',' 附近有语法错误。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 第 1 行: ',' 附近有语法错误。 源错误: 行 25: sda.SelectCommand=new SqlCommand("select employeeID,lastname,firstname,title from employees",con); 行 26: DataSet ds=new DataSet(); 行 27: sda.Fill(ds,"emp"); 行 28: this.DataGrid1.DataSource=ds.Tables["emp"]; 行 29: this.DataGrid1.DataBind(); 源文件: c:\inetpub\wwwroot\datagridtext\webform1.aspx.cs 行: 27 堆栈跟踪: [SqlException: 第 1 行: ',' 附近有语法错误。] System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) DataGridText.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\datagridtext\webform1.aspx.cs:27 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()
|