我的問題是如何使用下面的代碼對datagridview進行數據綁定。請檢查它..謝謝!如何數據綁定DataGridView?
InsuranceLabel oInsurance = new InsuranceLabel(); //Retrieves the list of existing Insurance from my database
oInsurance.Name = grdInsurance.Columns(0).text; //Fields Name
oInsurance.City = grdInsurance.Columns(0).text; //Fields City
oInsurance.Category = grdInsurance.Columns(0).text; //Fields Category
grdInsurance.DataSource = oInsurance;
grdInsurance.AutoGenerateColumns = true; //not sure that's the property
grdInsurance.DataBind();
我希望你能幫助我..謝謝!
你爲什麼這樣做** oInsurance.Name = grdInsurance.Columns(0)的.text; ** ,你有什麼錯誤嗎? – V4Vendetta 2011-04-18 05:08:23