G
Guest
Hello Everyone,
I downloaded enterprise library 2.0 , 2006 today . I followed all the
instructions that were given in the documentation.
I tried to follow everything that was mentioned in QuickStart samples. I
made a small web application that did everything that Quick start sample was
doing and I can successfully complie the code.
Below is my code. This is the exact code that is written in quick start
samples
Database db = DatabaseFactory.CreateDatabase();
string sqlCommand = "sp_getUserId";
DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
// Retrieve products from the specified category.
db.AddInParameter(dbCommand, "LogOn", DbType.Int32, "abcde2");
// DataSet that will hold the returned results
DataSet productsDataSet = null;
productsDataSet = db.ExecuteDataSet(dbCommand);
return productsDataSet;
The dll's I am including are
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
other dll's that come automatically in the project are
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
I am getting a run time error on the first line of the code, Database db =
DatabaseFactory.CreateDatabase();
System.NullReferenceException {"Object reference not set to an instance of
an object."}
In the Quick startsamples they are not passing any parameter in
createDatabase().
Please let me know what am I doing wrong.
Thanks
I downloaded enterprise library 2.0 , 2006 today . I followed all the
instructions that were given in the documentation.
I tried to follow everything that was mentioned in QuickStart samples. I
made a small web application that did everything that Quick start sample was
doing and I can successfully complie the code.
Below is my code. This is the exact code that is written in quick start
samples
Database db = DatabaseFactory.CreateDatabase();
string sqlCommand = "sp_getUserId";
DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);
// Retrieve products from the specified category.
db.AddInParameter(dbCommand, "LogOn", DbType.Int32, "abcde2");
// DataSet that will hold the returned results
DataSet productsDataSet = null;
productsDataSet = db.ExecuteDataSet(dbCommand);
return productsDataSet;
The dll's I am including are
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
other dll's that come automatically in the project are
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
I am getting a run time error on the first line of the code, Database db =
DatabaseFactory.CreateDatabase();
System.NullReferenceException {"Object reference not set to an instance of
an object."}
In the Quick startsamples they are not passing any parameter in
createDatabase().
Please let me know what am I doing wrong.
Thanks