DataGrid 绑定一个表
private void Form1_Load(object sender, System.EventArgs e){
string str="server=.;uid=sa;password=;database=test";
string str1="select * from student";
SqlConnection con=new SqlConnection(str);
SqlDataAdapter da=new SqlDataAdapter(str1,con);
DataSet ds=new DataSet();
try
{
da.Fill(ds,"gao");
this.dataGrid1.DataSource=ds;
this.dataGrid1.DataBindings; >>>>>>>>>>>>>>就行代码不对
}
catch(Exception ee){
MessageBox.Show(ee.ToString());
}
}
是怎么回事啊