仅将其引用添加1次System.Data.SqlClient [英] add its ref only 1 time System.Data.SqlClient

查看:58
本文介绍了仅将其引用添加1次System.Data.SqlClient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了"System.Data.SqlClient"
在文件后面的每个aspx代码上(局部类)

是否可以在整个项目中仅添加1次使用?

感谢

I have add " System.Data.SqlClient "
on every aspx code behind file ( Partial Classes )

Is it Possible to add it only 1 time to use throughout the project ??


thanks

推荐答案

您在这里混淆了两件事.对于解决方案的每个项目,仅添加一次引用即可.您的意思是添加using(C#)子句(对于VB.NETers为import).这需要添加到您要使用某个程序包的每个文件中.

问候,

曼弗雷德(Manfred)
You are confusing two things here. Adding a reference is only done once for each project of a solution. What you meant was adding the using (C#) clause (import for the VB.NETers). This needs to be added to each and every file where you are trying to use a certain package.

Regards,

Manfred


你好,

您需要在每个页面上添加引用,这在项目中不允许一次.

您可以创建一个类并放置一次引用,然后创建该类的对象并访问方法.


可以尝试这样做
Hello,

You need to add the reference on each and every page, it doesnt allow only one time in project.

It is possible that you can create one class and put the reference one time and then create a object of that class and access the methods


can try this


做一件事,为数据访问创建一个单独的层,其中您需要添加SQLClient的引用,
并充分利用您的项目
Do one thing create a separate layer for data access , where u need to add reference of the SQLClient,
And take this advantage to your project


这篇关于仅将其引用添加1次System.Data.SqlClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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