Skip to main content

All Questions

-1 votes
1 answer
125 views

Modern Location for Connection Strings in .Net 5+ Projects Utilizing Class Libraries or a Data Access Layer? [closed]

It seems that many .net tutorials storing connection strings are very simple projects not using a separate data access layer, or are fairly old. What is the current best practice for storing a ...
David Mays's user avatar
0 votes
2 answers
331 views

'EmployeeDBEntities' could be found in the application config file in C# Class Library project

I am trying to get a list of books from database in my class library project, there is a windows service which is using it. I am using entity framework to query the db, but not able to get the list. ...
sharpshooter's user avatar
0 votes
1 answer
269 views

How to pass connectionstring value from Unity3d to a classlibrary with ConfigurationManager

I created a class named "DB" in a ClassLibrary named "DBLayer" to connect a database named "LinguisticsDB". When I implement this ClassLibrary into another project, it can connect its App.config file ...
Mehmet Cengiz's user avatar
6 votes
4 answers
16k views

How to read connection string inside .NET Standard Class library project from ASP.NET Core

In my solution, I have a ASP.NET Core web project and a .NET Standard class library project. Class library project is the data access layer and I want to read the connection string from my appsettings....
Learning Curve's user avatar
0 votes
2 answers
125 views

Connection String retrieved from one DB to be used in a Class Library to access a 2nd DB...Suggestions?

Environment: .Net, SQL Server, WinForms Desktop Control Database (db1) Customer Databases (db2, db3, db4, etc.) Background: Each of our customers requires their own database. It's a contractual ...
Chase's user avatar
  • 179
0 votes
1 answer
159 views

Error with App.config connectionstrign in class library

I have an error with connection string in class library project. In Appconfig I have this code: <connectionStrings> <add name="DefaultConnection" connectionString="Data Source=DESKTOP-...
Optimus's user avatar
  • 93
1 vote
1 answer
2k views

Access asp net core application connection string from another project

I have a ASP NET CORE project, where I have a connection string and my dbcontext is in a .net 4.52 class library project. I would like to know how to access the connection string from the asp net core ...
Bernardo Magalhães's user avatar
0 votes
1 answer
340 views

Setting SQL Server CE connection for a dll class library

I can build an app using Windows Forms connecting to a SQL Server CE .sdf file to read and write. Now I need to do the same for a class library .dll project which intended to be a Revit Add-in so I ...
Ibrahem Hamdy Naeem's user avatar
3 votes
3 answers
379 views

Using entity model in class library

I have a project solution consisting of two class libraries and a Windows Application. The two libraries are split into Custom_Classes and Custom_Controls. Im my Custom_Classes library I have a ...
Juan Gous's user avatar
  • 249
4 votes
1 answer
3k views

why connection string is not found from my class library to another class library?

I am having the architecture like this : Where MVC layer is the presentation layer. EF is class library and Repository is another class library.I am trying to insert data to database from ...
Red Swan's user avatar
  • 15.4k
1 vote
2 answers
3k views

Reading a connection string from a class library

I am currently struggling to read a connection string from the App.config inside my WinForms application from my Class Library (and Unit Testing). I added a 'test' entry to the App.config; <...
Roel's user avatar
  • 754
0 votes
1 answer
341 views

Where is my connectionstring stored in a class library?

I've just generated some EF models from my EDMX designer in a class library. I chose to create a new connection string because the one that I defined in my app.config wasn't picked up. So Visual ...
ReFocus's user avatar
  • 1,521
2 votes
1 answer
2k views

How to refer to app.config for connection string when adding dataset using dataset wizard?

Whenever I add dataset in my class library project using the wizard it gives me an option to save the connection string in app.config file and after selecting the option it do save the string in file ...
Safran Ali's user avatar
  • 4,477
0 votes
1 answer
223 views

Really Struggling with Class Library, How do I Handle Lazy Loading/ConnectionString in Library?

I'm really struggling to get my head around the idea of working with a Class Library and I'm pretty much at the point of just maintaining separate projects with duplicate classes rather than a shared ...
Westicle's user avatar
0 votes
1 answer
2k views

ConnectionString In Class Library

I'm merging two of my projects that can share a lot of the same classes into one solution with two web applications and a shared class library. I've literally just dumped all the classes into the ...
Westicle's user avatar

15 30 50 per page