将数据集返回到业务层&在表示层的datagrid中显示 [英] Return Dataset to Business Layer & SHOW in datagrid in Presentation Layer

查看:57
本文介绍了将数据集返回到业务层&在表示层的datagrid中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我如何将数据集返回到datagriedview
我的业务层是memberBL Class
我的数据访问层是memberDA类
我在memberDL类中查看数据集代码是

hi
how i can return dataset to datagriedview
My business layer is memberBL Class
My Data Access Layer Is memberDA Class
My view Dataset Code in memberDL Class is

public DataSet View(memberBL member)
{
    DataSet ds = null;
    try
    {
        OpenCnn();

        String selectStr = "select * from " + thisTable + "''";

        OleDbDataAdapter da =new OleDbDataAdapter(selectStr, cnn);

        ds = new DataSet();

        da.Fill(ds, thisTable);

        CloseCnn();
    }
    catch (Exception e)
    {
        String Str = e.Message;
    }
    return ds;
}


如何在表格的GriedView中返回数据集?
我如何在ds IN Windows窗体中使用?


How I Can return Dataset in GriedView in Form?
hoW i can use in ds IN windows FORM?

推荐答案

仅在窗口窗体中,添加对您的DataAccessLayer 的引用,然后调用此成员.

取返回值并设置为DataGrid.DataSorce.

那就是你所需要的.
Just in the window form, add reference to your DataAccessLayer and then Call this member.

Take the return value and set to DataGrid.DataSorce.

Thats all u need.


我是初学者
请给我解释
请..........
i am beginer
please explain me
please ..........


这篇关于将数据集返回到业务层&在表示层的datagrid中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆