DataGrid嵌套时出错 http://dotnet.aspx.cc/ShowDetail.aspx?id=149E5DD7-3B32-461e-ACC6-51D1652E6746 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 孟老大:我就是根据你这个做的,只不过把VB改成C#了Command.Fill(ds);为什么会提示:在 SQL 语句结尾之后找到字符???????????? string strsql="Select * from DaLei order by Pu; Select * from XiaoLei";OleDbDataAdapter Command=new OleDbDataAdapter(strsql,MyConnection);DataSet ds=new DataSet();改成这样了,还是出错错误提示一样:在 SQL 语句结尾之后找到字符Command.Fill(ds);MyConnection.Close();ds.Tables[0].TableName="DaLei";ds.Tables[1].TableName="XiaoLei";DataColumn Parent=ds.Tables["DaLei"].Columns["DaLeiMing"];DataColumn Child=ds.Tables["XiaoLei"].Columns["XiaoLeiMing"];DataRelation OrderRelation=new DataRelation("OrderRelation",Parent,Child,false);ds.Relations.Add(OrderRelation);DataGrid1.DataSource=ds.Tables["DaLei"].DefaultView;DataGrid1.DataBind(); string strsql="Select * from DaLei order by Pu; Select * from XiaoLei";这个不行!干嘛写2个SQL语句? 错误信息的意思是说在结束符“;”号还有东东 net_lover(孟子E章)的文章不错! 问题很显然,出在SQL语句上!多试一下. 方法一:string strsql="Select * from DaLei order by Pu";string str="Select * from XiaoLei";OleDbDataAdapter Command=new OleDbDataAdapter(strsql,MyConnection);OleDbDataAdapter Command1=new OleDbDataAdapter(str,MyConnection);DataSet ds=new DataSet();Command.Fill(ds);Command1.Fill(ds); 二:string strsql="Select * from DaLei a ,XiaoLei b order by Pu"; by pu=========>by a.pu 你把分号去掉试试。数据库中两个SQL之间都不用分号的。 在win7上的问题,求解! string.Format 格式问题 怎么设置Gridview的标头 验证两个TextBox为空的 问题!!!!!!!! 谁能找到免费asp.net空间网站? 如何安装MS自带的数据库?我老是装不上!分不够可以再加! (高分相送)这种方式怎么不能下载了? Web程序中怎样弹出一个浮动窗体 常说的.net组件是什么东西? asp.net 按照table导出Excel问题 50分,新手求救,帮我看看这个出了什么错! 可以忽略参数的存储过程?
我就是根据你这个做的,只不过把VB改成C#了Command.Fill(ds);为什么会提示:在 SQL 语句结尾之后找到字符????????????
OleDbDataAdapter Command=new OleDbDataAdapter(strsql,MyConnection);
DataSet ds=new DataSet();
改成这样了,还是出错
错误提示一样:在 SQL 语句结尾之后找到字符Command.Fill(ds);
MyConnection.Close();
ds.Tables[0].TableName="DaLei";
ds.Tables[1].TableName="XiaoLei";
DataColumn Parent=ds.Tables["DaLei"].Columns["DaLeiMing"];
DataColumn Child=ds.Tables["XiaoLei"].Columns["XiaoLeiMing"];
DataRelation OrderRelation=new DataRelation("OrderRelation",Parent,Child,false);
ds.Relations.Add(OrderRelation);
DataGrid1.DataSource=ds.Tables["DaLei"].DefaultView;
DataGrid1.DataBind();
这个不行!干嘛写2个SQL语句? 错误信息的意思是说在结束符“;”号还有东东
string strsql="Select * from DaLei order by Pu";
string str="Select * from XiaoLei";
OleDbDataAdapter Command=new OleDbDataAdapter(strsql,MyConnection);
OleDbDataAdapter Command1=new OleDbDataAdapter(str,MyConnection);
DataSet ds=new DataSet();
Command.Fill(ds);
Command1.Fill(ds);
string strsql="Select * from DaLei a ,XiaoLei b order by Pu";
=========>
by a.pu
数据库中两个SQL之间都不用分号的。