查看: 722|回复: 0
|
visual c++.net problem (datagrid binding)
[复制链接]
|
|
sorry cannto type chinese word......
how to fix the below code.(let said i had 4 tables and want to join into 1 table , display in datagrid)
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
SqlConnection* sqlConn =
new SqlConnection(S"server=localhost;trusted_connection=true;database=pubs");
SqlDataAdapter* sqlA =
new SqlDataAdapter(S"select client.clientNo,client.cName,propertyforrent.propertyNo,propertyforrent.pAddress,propertyforrent.rent,rental.rentStart,rental.rentFinish,owner.ownerNo,owner.oName from client,propertyforrent,rental,owner where client.clientNo=rental.clientNo and owner.ownerNO=propertyforrent.ownerno and rental.propertyNo=propertyforrent.propertyNo",
sqlConn);
DataSet* dsEmployees = new DataSet;
error here--> [color=Red]sqlA->Fill(dsEmployees,S"client");[/color] sqlA->Fill(dsEmployees,S"owner");
sqlA->Fill(dsEmployees,S"propertyforrent");
sqlA->Fill(dsEmployees,S"rental");
this->dataGrid1->DataSource = dsEmployees;
this->dataGrid1->DataMember = S"client";
this->dataGrid1->DataMember = S"owner";
this->dataGrid1->DataMember = S"propertyforrent";
this->dataGrid1->DataMember = S"rental";
} |
|
|
|
|
|
|
| |
本周最热论坛帖子
|