佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 721|回复: 0

visual c++.net problem (datagrid binding)

[复制链接]
发表于 14-12-2006 10:55 PM | 显示全部楼层 |阅读模式
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";

                         }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT


本周最热论坛帖子本周最热论坛帖子

ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 26-8-2025 02:07 PM , Processed in 0.141397 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表