Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Sir ,

I want to know that how can be create .dll file & how can connect database sqlser to .dll file in asp.net C#
Posted
Comments
Stephen Hewison 26-Sep-12 8:17am    
This isn't a very clear question. Perhaps a little more information about what you're trying to do?

1 solution

I am going to try to answer what I think your question is which is "how do I structure my code so that the database connectivity is handled in a separate dll?". If this is not the case, then please let me know and i will remove this solution.

What you need is an n-tier architecture and this Creating ASP.NET Applications with N-Tier Architecture[^] is one of the millions of articles you can refer to via Google.

Basically, you will have a Business Layer a separate C# class library project i.e. a dll, a Data Access Layer as another separate C# class library project i.e. a dll and a presentation layer typically a web-forms ASP.NET application which will have a dll and aspx pages for the UI. The Data Access Layer (DAL) would be the dll where your data access code will go. If the database server is on another computer (VM or physical), then you would need the appropriate connection string for that machine and make sure your database server is set to allow remote TCP connections. Let me know if this helps or not.

Cheers
 
Share this answer
 
v2
Comments
I.explore.code 26-Sep-12 10:03am    
thanks Marc for the paragraphing ;) I sometimes get very lazy...
Rachana Gaur 28-Sep-12 5:52am    
not fully but this code help me
Rachana Gaur 28-Sep-12 5:57am    
I also want to konw how we can make BLL Or DAL in asp .net for web application
I.explore.code 28-Sep-12 7:36am    
you create 2 new class library projects in the same solution for BLL and DAL and then add reference to BLL in your Presentation Layer and reference to DAL in your BLL. I am sure you can find a ton more articles like the one I posted that go in a lot more detail.

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