Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error in code - with Stored Proc
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Error in code - with Stored Proc
Divers
Thread ID:
00928301
Message ID:
00928301
Vues:
58
I keep getting this error and i can't make any sense from it.
I have reviewed the line in error and it makes no sense to my why it is saying this :
"Object reference not set to an instance of an object."


P.S. if i do :
this.oCompany the intellisense picks up the object and its methods

Code
//Business Object
public Company oCompany;

public string ValidateCompanyUserIDExists(string CompanyUserID)
{
	string Message = null;
//Defined ds as a DataSet
	DataSet ds;
//Erorr Line Below - this.oCompany is pasted below
	ds = this.oCompany.CheckIfCompanyUserIdExists(CompanyUserID);
//
	if (int.Parse(ds.Tables["CompanyExists"].Rows[0].ToString()) != 0)
	{
		Message = "The Company User ID already exists in the database please selct another Company User ID";
		this.AddErrorProviderBrokenRule(CompanyUserID,Message);
	}
	return Message;
}

//========================================
//========================================
// This.oCompany.CheckIfCompanyUserIdExists

public DataSet CheckIfCompanyUserIdExists(string CompanyUserID)
{
	// Get a reference to the data access object
	mmDataAccessBase dao = this.GetDataAccessObject();

	// Create and configure two parameter objects
	IDbDataParameter sqlparCompanyUserID = dao.CreateParameter("@CompanyUserID",CompanyUserID);

	return this.GetDataSet("CheckIfCompanyUserIDExists","CompanyExists",this.DatabaseKey,CommandType.StoredProcedure,sqlparCompanyUserID);
}
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform