为什么会显示不出来
手写datagridview代码!
public void CurrencyManagerForm_Load(object sender, System.EventArgs e)
{
if (this.datc.fnGetDataConnection())
{
this.dataGridView1.ReadOnly = true;
this.dataGridView1.DataSource = datc.dSet.Tables["PersonalTable"];
this.dataGridView1.DataMember = "PersonalTable";
fnGetDataBindingForTextBoxes();
//set CurrencyManager for the "PersonTable" table
fnSetCurrencyManager();
//display record numbers in the StatusBar
//fnDisplayRecordNumbers();
} else {
MessageBox.Show("Connection failed...");
Application.Exit(); //end the program
}
}
private void fnGetDataBindingForTextBoxes()
{
//DataBindings for all TextBoxes on the Form
this.textboxFirstname.DataBindings.Add("Text", datc.dSet.Tables["PersonalTable"],"FirstName");
this.textboxLastname.DataBindings.Add("Text", datc.dSet.Tables["PersonalTable"],"LastName");
this.textboxTitle.DataBindings.Add("Text", datc.dSet.Tables["PersonalTable"],"Title");
this.textboxCity.DataBindings.Add("Text", datc.dSet.Tables["PersonalTable"],"City");
this.textboxCountry.DataBindings.Add("Text", datc.dSet.Tables["PersonalTable"],"Country");
}
public void fnSetCurrencyManager()
{
//Initialize CurrencyManager for the table "PersonTable"
currManager=(CurrencyManager)this.BindingContext[datc.dSet.Tables["PersonalTable"]];
}
为什么运行后控件不显示任何数据!!
求大哥来帮忙 自己晕了!!失落!!