Hi There,
I'm using CSLA 3.6
I keep getting the error:
DataPortal.Fetch failed (Database name not found in config file (AdventureWorksLT))
My Dataportal_Fetch code looks like this :
Private Overloads Sub DataPortal_Fetch(ByVal criteria As SingleCriteria(Of Customer, Integer))
Using ctx = ContextManager(Of DalLinq.AdventureWorksDataContext).GetManager(DalLinq.Database.AdventureWorksLTConnectionString)
Dim data = (From p In ctx.DataContext.Customers Where p.CustomerID = criteria.Value Select p).Single
LoadProperty(Of Integer)(CustomerIdProperty, data.CustomerID)
LoadProperty(Of String)(CompanyNameProperty, data.CompanyName)
End Using
End Sub
My Database.vb file looks like this:
Public Class Database
Public Const AdventureWorksLTConnectionString As String = "AdventureWorksLT"
End Class
And my App.Config file contains the following(Substitutes < and > character with ( and ) due to stackoverflow :
(connectionStrings) (add name="AdventureWorksLT" connectionString="Data Source=(local);Initial Catalog=AdventureWorksLT;User Id=AdvWorks;Password=UserPW;" providerName="System.Data.SqlClient" /) (/connectionStrings)
What am I missing?
Thanks!