简体   繁体   English

如何在c#中从BLL访问DataSet

[英]How to access DataSet From BLL in c#

I'm sorry for the question, but I'm new with the BLL :( 我很抱歉这个问题,但我是新的BLL :(

I have my DAL with a dsUsers.xsd created. 我有一个创建了dsUsers.xsd的DAL。

Now I'm trying to develop the BLL for UserBLL, 现在我正在尝试为UserBLL开发BLL,

I realized that in some examples on the web, they make reference to the table adapters like this: 我意识到在网络上的一些例子中,他们像这样引用表适配器:

using System.Data.SqlClient;
using dsUserTableAdapters;

But every time I trying to add the last part of the above code, I get nothing starting with that name, 但每次我尝试添加上面代码的最后一部分时,我都没有从该名称开始,

Do I missing something here? 我在这里遗漏了什么吗?

You need to add a reference to your DAL library to your BLL. 您需要将DAL库的引用添加到BLL。 Then, you can reference the dataset like so: 然后,您可以像这样引用数据集:

using MyDal.MyDataSetNamespace;

You can then create an object of your dataset type 然后,您可以创建数据集类型的对象

MyDataSet ds = new MyDataSet();

EDIT: To add a reference of your DAL to your BLL, right click the BLL project and choose Add Reference . 编辑:要将DAL的引用添加到BLL,请右键单击BLL项目并选择“ Add Reference In the window that pops up, choose the Projects tab and select your DAL project. 在弹出的窗口中,选择Projects选项卡并选择您的DAL项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM