PC Review


Reply
Thread Tools Rate Thread

How to allow edit on datatable loaded from sqldatareader from view

 
 
Clay
Guest
Posts: n/a
 
      4th Feb 2009
I am getting the error System.Data.ReadOnlyException was unhandled
Message="Column 'name' is read only." that I need to resolve and not sure
how. We are querying an MSSQL server view that is returned as an
SqlDataReader. We then load a datatable from the return sqldatareader. In
our application we need to mask/hide data based on user permissions. I am
looping through each datarow and trying to edit the columns that need to be
masked. We are only using the datatable to present the data in a grid. The
user can't change or save the information back to the database. How can I
allow edit on the datatable?
 
Reply With Quote
 
 
 
 
Mary Chipman [MSFT]
Guest
Posts: n/a
 
      6th Feb 2009
I'd tackle the problem from the other end, and only fetch the data you
want the user to see by creating a store procedure that takes the user
name as an input parameter. Or if not a stored procedure, add a WHERE
clause to apply the appropriate filter.

--Mary

On Wed, 4 Feb 2009 09:51:05 -0800, Clay
<(E-Mail Removed)> wrote:

>I am getting the error System.Data.ReadOnlyException was unhandled
>Message="Column 'name' is read only." that I need to resolve and not sure
>how. We are querying an MSSQL server view that is returned as an
>SqlDataReader. We then load a datatable from the return sqldatareader. In
>our application we need to mask/hide data based on user permissions. I am
>looping through each datarow and trying to edit the columns that need to be
>masked. We are only using the datatable to present the data in a grid. The
>user can't change or save the information back to the database. How can I
>allow edit on the datatable?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlDatareader & Datatable vs Dataset ary Microsoft ASP .NET 5 22nd Aug 2007 12:07 PM
Edit Datatable using data view problem sri Microsoft Dot NET Framework 0 5th Sep 2003 10:17 PM
Edit Datatable using data view problem sri Microsoft ADO .NET 0 5th Sep 2003 10:17 PM
Edit Datatable using data view problem sri Microsoft Dot NET 0 5th Sep 2003 10:17 PM
Edit Datatable using data view problem sri Microsoft ASP .NET 0 5th Sep 2003 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:04 AM.