Why i got this error ? No connection string named '' could be found in the application config file [closed]

StackOverflow https://stackoverflow.com/questions/16587213

  •  29-05-2022
  •  | 
  •  

Pregunta

I have a DAL project using entity framework. I refer the project into BAL project, when i execute the BAL project. i got the error like

"No connection string named 'StudentEntities' could be found in the application config file."

Then i copied the DAL project connection string and the paste the BAL project web config.That time my error would fixed. but my question is.

We exexute the BAL, the BAl call the DAL, already DAL have connection string the why we got this error ?

Why Microsoft did like this ?

Is anything reasons ?

Note: This error discussed more times in stackoverflow but my question is different from other

¿Fue útil?

Solución

Because configuration is read from the config file of the entry project, which in this case BAL. Otherwise you would not be able to use your DAL project in different projects with different connection strings

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top