求教:有关ASP.net中SqlDataSource与GridView的问题!
int ElapseDay = 3;
string TableTitle = "t_ ";
string[] sTmpTable;
sTmpTable = new string[4];
SqlDataSource1.Delete(); // "DELETE FROM tmp_Query "
for (int i = 0 ; i < ElapseDay ; i++)
{
sTmpTable[i] = TableTitle + Convert.ToString(Convert.ToInt32( "20070410 ") + i);
SqlDataSource1.SelectCommand = "INSERT INTO tmp_Query SELECT * FROM " + sTmpTable[i] ";
}
SqlDataSource1.SelectCommand = SqlDataSource1.SelectCommand;
// 已经在控件上绑定
//GridView1.DataSource = SqlDataSource1.SelectCommand;
GridView1.DataBind();
谢谢
------解决方案--------------------你上面的用的是SqlDataSource1.SelectCommand
后面又是SqlDataSource1.InsertCommand
是不是这里有错误呀
------解决方案--------------------看不懂你的代码,有种自虐倾向。
------解决方案--------------------SqlDataSource1.SelectCommand = "INSERT INTO tmp_Query SELECT * FROM " + sTmpTable[i] ";
这里是insert,怎么是 selectcommand呢?