NullReferenceException for System.Data.SQLClient

S

sxiao

Hi, there

I got a NullReferenceException when there are more than one users
trying to open the same page at the same time. The senerio is:

Two users logged into the web application using the Windows domain user
account and tried to open the same page which has the databasde query
code. When the two user tried to open the same page at the same time,
there is a runtime error messsage showing as follows:

Server Error in '/reprICEsys' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.


Stack Trace:


[NullReferenceException: Object reference not set to an instance of an
object.]
System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean
useSQLTypes, Boolean byteAccess, Boolean& isNull) +269
System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean
useSQLTypes, Boolean byteAccess) +28
System.Data.SqlClient.SqlDataReader.GetValues(Object[] values) +110
System.Data.Common.SchemaMapping.LoadDataRow(Boolean
clearDataValues, Boolean acceptChanges) +61
System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping
mapping) +155
System.Data.Common.DbDataAdapter.FillFromReader(Object data, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
DataColumn parentChapterColumn, Object parentChapterValue) +260
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDataReader dataReader) +90
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDbCommand command, CommandBehavior behavior) +28
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +88
reprICEsys_Web2.FinHdrListing.MakeDataset(String RecordSourceStr,
String SelStrDetail) +186

reprICEsys_Web2.FinHdrListing.GridClaimsList_InitializeDataSource(Object
sender, UltraGridEventArgs e) +121

Infragistics.WebUI.UltraWebGrid.UltraWebGrid.OnInitializeDataSource()
+77
Infragistics.WebUI.UltraWebGrid.UltraWebGrid.Control_Load(Object
sender, EventArgs e) +97
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750


Does anybody have any idea on how to solve this? Thanks in advance.
 
G

Guest

I would have to see the code to determine exactly what is not being created
(looks like the connection?).

It also appears that you are using an Infragistics DataGrid control, which
may encapsulate some of the data logic. If so, it may be the source of your
error; as I am not that familiar with their controls, I cannot advise on this.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


sxiao said:
Hi, there

I got a NullReferenceException when there are more than one users
trying to open the same page at the same time. The senerio is:

Two users logged into the web application using the Windows domain user
account and tried to open the same page which has the databasde query
code. When the two user tried to open the same page at the same time,
there is a runtime error messsage showing as follows:

Server Error in '/reprICEsys' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.


Stack Trace:


[NullReferenceException: Object reference not set to an instance of an
object.]
System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean
useSQLTypes, Boolean byteAccess, Boolean& isNull) +269
System.Data.SqlClient.SqlDataReader.SeqRead(Int32 i, Boolean
useSQLTypes, Boolean byteAccess) +28
System.Data.SqlClient.SqlDataReader.GetValues(Object[] values) +110
System.Data.Common.SchemaMapping.LoadDataRow(Boolean
clearDataValues, Boolean acceptChanges) +61
System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping
mapping) +155
System.Data.Common.DbDataAdapter.FillFromReader(Object data, String
srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
DataColumn parentChapterColumn, Object parentChapterValue) +260
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDataReader dataReader) +90
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable,
IDbCommand command, CommandBehavior behavior) +28
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +88
reprICEsys_Web2.FinHdrListing.MakeDataset(String RecordSourceStr,
String SelStrDetail) +186

reprICEsys_Web2.FinHdrListing.GridClaimsList_InitializeDataSource(Object
sender, UltraGridEventArgs e) +121

Infragistics.WebUI.UltraWebGrid.UltraWebGrid.OnInitializeDataSource()
+77
Infragistics.WebUI.UltraWebGrid.UltraWebGrid.Control_Load(Object
sender, EventArgs e) +97
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750


Does anybody have any idea on how to solve this? Thanks in advance.
 
S

Sherry Xiao

The problem is that I can't make this error happen when I am in my
project in debug mode. What is interesting is that when I right click
the page to refresh the page, the data shows. It seems like it's kind of
conflicting between two users when they open the page at the same time.
But the data is actually loaded but needed to be refreshed.

So I am thinkging about if there is a way (just like I manaully refresh
the page)in my code to refresh the page when the error happens. This is
the alternative solution I can think about if I can't figure out what
exactly happened there.

Any suggestions? Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top