The name 'CreateDatabase' does not exist in the current context

Apr 18, 2008 at 2:34 AM
Edited Apr 18, 2008 at 2:35 AM
Sometimes I really hate Enterprise Library due to lack of understandable documentation, and just configuring the damn thing.

Ok, so I had this all working fine in regards to this method working. I copied my solution as well as the EnterpriseLibrary folder under Program Files and backed those folders up to an external SATA. I then reimaged my Vista machine. Put back everything the same. Now when I re-run the same solution, same exact code, this method below does not return any data. And yes, my DB has the right permissions, right users, and I even tested the DB connection string from within the Enterprise Library Config tool again. But now after my .aspx page loads, it does go through this method below but when I step through it, I get no data and no real good error message except for the one I posted in the Title of this post. Also, Intellisense doesn't complain about the CreateDatabase method nor does the compiler except for just that warning.

So what the hell do I look at. With no real good error message to go on, and the DB connection working in the tool just as it had, and with the same permissions set in SQL Server, what the heck! so frustrating.

The method (and other methods that did work also don't work now, and yes the proc IS there and data IS in the tables)

public static List<BeanOption> RetrieveAll()
{
List<BeanOption> beanOptionList = new List<BeanOption>();
Database db = DatabaseFactory.CreateDatabase();
using (DbCommand cmd = db.GetStoredProcCommand("dbo.BeanOptionAllS"))
{
try
{

using (IDataReader reader = db.ExecuteReader(cmd)) <<<< It gets to here then throws an exception
{
while (reader.Read())
{
BeanOption newBeanOption = new BeanOption();
newBeanOption.LoadFromReader(reader);
beanOptionList.Add(newBeanOption);
}
}
}
catch (Exception ex)
{

if (ExceptionPolicy.HandleException(ex, "Elbalazo.DataLayer.Exceptions"))
{
throw;
}
}
}
return beanOptionList;
}
Apr 18, 2008 at 2:50 AM
alright nevermind. I had an old DataSet extension assembly, nothing to do with Enterprise Library actually. I had this in my web.config:

<add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

and I needed to remove it and add the 3.5 assembly to my web project.


expresso wrote:
Sometimes I really hate Enterprise Library due to lack of understandable documentation, and just configuring the damn thing.

Ok, so I had this all working fine in regards to this method working. I copied my solution as well as the EnterpriseLibrary folder under Program Files and backed those folders up to an external SATA. I then reimaged my Vista machine. Put back everything the same. Now when I re-run the same solution, same exact code, this method below does not return any data. And yes, my DB has the right permissions, right users, and I even tested the DB connection string from within the Enterprise Library Config tool again. But now after my .aspx page loads, it does go through this method below but when I step through it, I get no data and no real good error message except for the one I posted in the Title of this post. Also, Intellisense doesn't complain about the CreateDatabase method nor does the compiler except for just that warning.

So what the hell do I look at. With no real good error message to go on, and the DB connection working in the tool just as it had, and with the same permissions set in SQL Server, what the heck! so frustrating.

The method (and other methods that did work also don't work now, and yes the proc IS there and data IS in the tables)

public static List<BeanOption> RetrieveAll()
{
List<BeanOption> beanOptionList = new List<BeanOption>();
Database db = DatabaseFactory.CreateDatabase();
using (DbCommand cmd = db.GetStoredProcCommand("dbo.BeanOptionAllS"))
{
try
{

using (IDataReader reader = db.ExecuteReader(cmd)) <<<< It gets to here then throws an exception
{
while (reader.Read())
{
BeanOption newBeanOption = new BeanOption();
newBeanOption.LoadFromReader(reader);
beanOptionList.Add(newBeanOption);
}
}
}
catch (Exception ex)
{

if (ExceptionPolicy.HandleException(ex, "Elbalazo.DataLayer.Exceptions"))
{
throw;
}
}
}
return beanOptionList;
}