Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding to multiple copies of table
Message
From
17/05/2006 16:06:43
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
17/05/2006 13:14:23
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01114964
Message ID:
01122981
Views:
20
Hello, Jeff

Looking at the VS help docs, I see this about ReadOnlyException:


Represents the exception that is thrown when you try to change the value of a read-only column.


It also goes on to mention this exception is raised in a couple instances, once of which is calling EndEdit() when a read-only column has been altered. The framework calls EndEdit when saving data.

I would look at the data after you run your FillDataSet, checking the ReadOnly property on the columns to see which one(s) are causing this.

As far as the Entity, it's meant to store one record's worth of data. The first time it's used, it's automatically populated with the first record from the most recent FillDataSet(). You could get the Entity property re-populate itself again by setting this.Entity to null, but I wouldn't take this approach if you plan to alternate between tables.

If you want to track multiple tables' data, I'd suggest creating multiple entity objects, one for each DataTable you want to refer to in a strongly typed manner. You'd have to specify in code which table's DataRow to store in each Entity, but I think that would give you what you're looking for.

Hope that helps,
---J

>I've been working on the One bizObj with multiple tables in Microsoft SQL. I've run across an interesting problem. When I make a change in the mmTextBox, it isn't saved. I'm viewing the data from the database correctly, but no data is changing.
>
>As I started looking into what is going on, when I execute
>
>
>     oAddress.SaveDataSet("Mailing")
>
>
>I get an exception 'System.Data.ReadOnlyException' which indicates my table is read-only. In the business object I use
>
>
>     this.FillDataSet(this.DataSet, "SELECT * FROM " + this.PhysicalDbcObjectName
>          + " WHERE " + this.PrimaryKey + " = @PrimaryKey", tableName,
>          iD);
>
>
>to open the dataset where iD is a IDbDataParameter array.
>
>Also, I can't find a way to use the Entity with these tables. Is there a way to do something like
>
>
>oAddress.DataSet.Tables["Mailing"].Entity.City?
>
>
>Thanks for the help,
>Jeff
Previous
Reply
Map
View

Click here to load this message in the networking platform