你把DataGrid1.DataSource=ds;改成 this.datagrid1.datasource=ds.tables(0);
我试了一下我的,没有问题
for example:
string mystr="server=fixedchen;database=northwind;uid=sa;pwd=;";
SqlConnection mycon=new SqlConnection (mystr);
SqlDataAdapter myadapter=new SqlDataAdapter ("select * from orders",mycon);
DataTable mytable=new DataTable ();
myadapter.Fill(mytable);
this.DataGrid1.DataSource =mytable;
this.DataGrid1 .DataBind ();