Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 DataRowView does not contain a property with name

Author  Topic 

kiransuthar
Starting Member

9 Posts

Posted - 2009-09-17 : 07:18:17
Hello,
I am facing one weird problem in my live application.
I am using ASP.NET 3.5 (C#) and SQL server 2005, IIS 6.0, Windows Server 2003

I am getting error like

(1)'System.Data.DataRowView' does not contain a property with the name 'ProductName' ”
(2)'System.Data.DataRowView' does not contain a property with the name 'ProductPrice' ”

This type of error comes on different pages and it is weird because said columns in exceptions exists in table are returned from Procedure.
The same page works fine when we refresh it. So it process that column exists.

I have tried different approaches for database operations but none of them is helping.
My Connection string is
connectionString="Data Source=***;Initial Catalog=****;Persist Security Info=True;User ID=***** password=**********;MultipleActiveResultSets=True;Min Pool Size=1;Max Pool Size=550;"

Approach: 1
Using one single static connection object all over the application. Connection is opened from Application_BeginRequest() and closed from Application_EndRequest()
When connection is closed, it is also disposed.
Connection opening is closing is performed only when there is a request for .aspx page

The method which retrieves data checks that connection is opened or not and if it is not opened than only connection is opened.

Approach: 2
Each method is having its own connection object and method itself performs connection open and close operations.

Approach: 3
At last I have used Microsoft Application Blocks.
Mainly I am using SqlHelper.FillDataset() method.
I am just passing connection string, name of procedure and parameters to it.
Connection opening and closign and all related operation is performed by Microsoft Application Blocks.

Still I am getting the same problem and it occurs randomly it is not fixed.
I am really upset due to it. My client is also unhappy due to this problem.

Can anyone suggest what could be the problem?

Earlier I was using view in procedure but l have replaced it with actual tables but it did not help.

I think it is clear that problem is not in C# code but it can be from SQL server side issue. But what is the problem that I can’t understand.
I have taken SQL trace from server and studied it but I could not find any problem there.

Also application pool is getting recycled frequently so that is also one issue.

Thanks,
Kiran Suthar

kiransuthar
Starting Member

9 Posts

Posted - 2009-09-17 : 11:40:47
I am also getting error like "System.ArgumentException: Column '***' does not belong to table Table"
and by refreshing page, error goes away.
Said column exists in table and it is returned by Procedure.


It looks that problem is from SQL server side and not from c# code. But I can't find the problem.
Go to Top of Page
   

- Advertisement -