Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
We have created an application using asp.net and sql server 2008 r2 ,plus we use application state to fill dropdown list with common info like country,city etc..
the application working fine on development environment but when we publish our application on web server it throw Error :-

at System.Data.DataTableCollection.get_Item(Int32 index)
at ZlineDA.DAUser.UserAuthentication(BOUserCredentials objBOUserCredentials) in at DAUser.cs:line 67.one problem leads to another and application stop working

Scenario :- before error
Dropdown list 1) country :- India , Singapore

Function 1) geRefNumber() :- (REF001) Working fine


:- After Error
Dropdown List 1) country:- Nhava Sheva , Mundra etc..
function 1) getRefNumber() :- Cannot find table 0.

but error suddenly out when we refreshed our application (or modified web.config)
Dropdown list 1) country :- India , Singapore
Function 1) geRefNumber() :- (REF001) Working fine

we have dedicated web server with window web server 2008 r2 installed with sql server 2008 r2
please provide us quick solution.
thank you and advance..
Posted
Comments
Sunasara Imdadhusen 27-May-14 7:45am    
Please share your code
swapnil7090 28-Jun-14 6:11am    
Now see the code snippet.

if (ds.Tables[0].Rows[0]["OfficeID"] == DBNull.Value || Convert.ToString(ds.Tables[0].Rows[0]["OfficeID"]) == string.Empty)
{
objBOUserInformation.OfficeID = "";
}
else
{
objBOUserInformation.OfficeID = Convert.ToString(ds.Tables[0].Rows[0]["OfficeID"]);
}



we have checked whether columns is coming out null or not or Value is null or not.still.
the thing after coming into else condition it says
'System.Data.DataRowView' does not contain a property with the name 'OfficeID'
and when we reload web.config it start working without showing error give above

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900