仅将其引用添加1次System.Data.SqlClient

编程入门 行业动态 更新时间:2024-10-24 08:21:53
本文介绍了仅将其引用添加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

本文发布于:2023-11-17 06:52:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609214.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:将其   System   SqlClient   Data

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!