SqlConnection conn =new SqlConnection();
string Str = @"server=(local);"+"uid=toby;"+"pwd=***;"+"database=student;";
conn=new SqlConnection(Str);
DataSet r=new DataSet();
string selectSQL="SELECT * From stu WHERE name ='"+this.listBox1.Text+"'";
SqlDataAdapter da=new SqlDataAdapter();
da.SelectCommand=new SqlCommand(selectSQL,conn);
da.Fill(r,"stu");
textBox1.DataBindings.Add("text",r,"number");
textBox2.DataBindings.Add("text",r,"sex");
textBox3.DataBindings.Add("text",r,"telephone");
textBox4.DataBindings.Add("text",r,"QQ");
SqlConnection conn =new SqlConnection();
string Str = @"server=(local);"+"uid=toby;"+"pwd=***;"+"database=student;";
conn=new SqlConnection(Str);
DataSet r=new DataSet();
string selectSQL="SELECT * From stu" ;
SqlDataAdapter sa = new SqlDataAdapter(selectSQL,conn);
sa.Fill(r,"stu");
DataTable dt=r.Tables["stu"];
textBox1.DataBindings.Add("text",dt.Rows[listBox1.SelectedIndex],"number");
textBox2.DataBindings.Add("text",dt.Rows[listBox1.SelectedIndex],"sex");
textBox3.DataBindings.Add("text",dt.Rows[listBox1.SelectedIndex],"telephone");
textBox4.DataBindings.Add("text",dt.Rows[listBox1.SelectedIndex],"QQ");
请问下~~这两种都可以实现吗???我机子老报系统问题......