Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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
Posted

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
 
Share this answer
 
Comments
qasimidl 23-Jan-12 5:06am    
thanks
can you please give me sample code ?
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
 
Share this answer
 
Comments
Tech Code Freak 20-Jan-12 6:48am    
5up for the class!
qasimidl 23-Jan-12 5:06am    
thanks
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
 
Share this answer
 
Comments
Tech Code Freak 20-Jan-12 6:34am    
5up!
Very true!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900