Hi, I'm not sure if this is an EasyObjects question or a MyGeneration question or even a .Net question but I'll start here and focus on the EasyObjects part of it.
I'm working with an application that I would like to have access two different databases direclty via easy objects. My web.config file has two connection strings specified, one for each DB. I used MyGenerations to create EasyObjects and Sprocs for the required tables in each DB. The call to one DB is made from a custom page class that my webpage inherits. The other call is made directly from the page. The call from the page class works fine (it's using the default connection as specified in the web.config) but when trying to switch to a new connection and use the other database, I'm getting the infamous error "Object reference not set to an instance of an object" in the LoadAll function at this line
Return MyBase.LoadFromSql(Me.SchemaStoredProcedureWithSeparator & "daab_GetAllCategories", parameters, CommandType.StoredProcedure)
I think this is telling me that the Sproc doesn't exist which kind of indicates that I haven't correctly switched to the right connection. My call to easy objects looks something like this
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim c As New Categories 'This is the EasyObject
c.ConnectionString = ConfigurationManager.ConnectionStrings.Item("MyConnectionString").ToString()
c.LoadAll()
Me.RepeaterCategories.DataSource = c.DefaultView
Me.RepeaterCategories.DataBind()
End Sub
Both DB's are in the same Database Server instance on localhost. And the connection strings I'm using are correct and work in other situations. I'm sure I'm missing some important point here but have no idea what that would be. Any suggestions. Thank you very much.
