Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataSet readonly from a stored procedure
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 4.0
Database:
MS SQL Server
Miscellaneous
Thread ID:
01489891
Message ID:
01491608
Views:
42
>Don & Tim,
>
>I'm pretty sure the culprit is because of setting the DataAdapter.MissingSchemaAction property to MissingSchemaAction.AddWithKey. I'm not sure what to do about it (I don't use that setting) ... but I'm pretty sure that that's the only thing that would cause a DataColumn to be marked as ReadOnly.
>
>Hopefully you can track down some remedies/workarounds from here ... I can look at it further, but not until later today ... if you guys don't figure it out.
>
>~~Bonnie
>
>
>>>>>I am posting this because I am trying to help a client programmer but I am not at home where I can look at any of my code. He had problems with the DataSets when running against the two different stored procedures. When debugging he found one to be read-only. I assume that was a property of the either the dataset or the table within. Yes the framework is MM but I don't think (will check when home) there is anything in the framework that sets that and possibly it is detected because the stored procedures are different. I will look at it directly myself when I get home and see exactly what is going on. I had hoped there was a simple answer on how to force a dataset to be read-write.
>>>>
>>>>There is nothing inherent in a DataSet (nor a Typed DataSet) that would make any part of it read-only. Also the DataSet itself knows nothing about where it gets its data from ... so which Stored Procedure is filling it shouldn't matter either. Now, I know absolutely nothing about MM, so there could be something in there that's causing problems.
>>>>
>>>>I guess we'll have to wait until you get home to find out more info (specifically, exactly *what* is read-only).
>>>>
>>>>~~Bonnie
>>>
>>>Hi Bonnie,
>>>I am home but will be out teaching today and tomorrow so no real time. I do see some of what he sent me. Here was his specific comment.
>>>
>>>"What causes the incoming data from that DataAdapter to configure the rows in the DataTable as ReadOnly or NOT ReadOnly? In the attached screenshot, at line 600 the nano-second that the DataAdapter fills the DataSet, the Rows of the DataTable of that DataSet switch from ReadOnly = F to ReadOnly=T when one stored procedure is called but stays ReadOnly=F when another stored procedure is called. "
>>>
>>Hi all,
>> I'm the one causing this trouble. I mis-spoke in the paragraph above. It was not the ROWS of the DataTable that I was drilling down and checking the ReadOnly attribute of but rather the COLUMNS. Sorry about that.
>>As I stepped through the program I hovered over/drilled down to the following property: DataSet---Tables----non-public members----List----
>>[TableName]----Columns----non-public members----List---- [ColumName]----ReadOnly = (False/True depending on Stored Procedure used).
>>
>>
>>Thanks!
>>
>>Don
>>(Using Ron's account --to muddy the waters even further)


Bonnie,
Since I didn't understand any of what you and Tim were discussing, I was going to wait until the dust settled to post again. Then Thanksgiving came and now I'm finally getting settled again. I wanted to Thank you for your help. Until I can sit down with Tim and address the real issue, I'm just intercepting the dataset and changing the fields to ReadOnly=F.

Don
Ronald D. Edge
Retired from Indiana University Mar 1, 2011

"You've got to be very careful if you don't know where you are going,
because you might not get there."
“When you come to the fork in the road, take it.”
--Yogi Berra
Previous
Reply
Map
View

Click here to load this message in the networking platform