1
Vote

ExecuteReader Exception

description

Hi all ,
this is my first time to use this generator
I built it and called the function myObject.SelectAll();
and I got that error in
System.NullReferenceException: Object reference not set to an instance of an object.
 
in this line of code
 
using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader(connectionStringName, CommandType.StoredProcedure, "PHA_MASKSelectAll"))
 
and I'm sure that PHA_MASKSelectAll is created
my connectionstring is in the web.config file
 
<add name="MyCon" connectionString="Data Source=(local);Initial Catalog=PHA;User ID=sa;Password=sa"
  providerName="System.Data.SqlClient" />
 
so any help please ???

comments

seb916 wrote Sep 4, 2010 at 11:53 AM

Hi,

i have the same problem, is there still any idea for it?

jcasimiro wrote Mar 21, 2012 at 4:14 PM

I have the same problem when using it for the first time. After code analysis i understand that my problem is when i instance the datalayer with the content of the connectionstring. We must pass the name of the tag of the connectionstring in the web.config. The datalayer projects goes automatically to the config file of the solution trying to get the connection, so the only thing he is expected is na name of the connection string.

wrote Feb 13, 2013 at 9:27 PM