My EF code:The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
Code: Select all
using (var context = new SWPDMEngVaultEntitiesTwo())
{
var docNumber = (from p in context.Projects
join dip in context.DocumentsInProjects on p.ProjectID equals dip.ProjectID
join d in context.Documents on dip.DocumentID equals d.DocumentID
where p.Path == path
&& d.Filename == fileName
&& dip.Deleted == 0
select d.DocumentID).FirstOrDefault();
if (docNumber == 0)
{
throw new Exception("Part ID was not found.");
}
else
{
return docNumber.ToString();
}
}
**EDIT**
It seems that Entity Developer stores the connection string in the app.config file by default. The app.config file is not used in a class library. How to get the connection string in a class library?