Re: can this be done
- From: "sloan" <sloan@xxxxxxxxx>
- Date: Mon, 4 Aug 2008 11:14:01 -0400
Sure.
But when you have a known table and column structure (or rather, a known
Entity-Relationship mapping), I think its ... not wise...to not go with the
strong dataset.
Said another way, I think its alot better to go with the strong dataset.
But that's me.
I'll have to defer to someone else for the loose dataset stuff.
If you're avoiding a strong dataset because you don't control the source
xml, then check this blog entry I made:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!148.entry
"Mike" <whyyoulookingatme@xxxxxxxxx> wrote in message
news:uwtR0Fk9IHA.1192@xxxxxxxxxxxxxxxxxxxxxxx
I would rather not create a strongly typed DS if I don't have to. Is there
another way to do this, such as using a 'raw' XML file that I define?
"sloan" <sloan@xxxxxxxxx> wrote in message
news:uJqhbAk9IHA.3648@xxxxxxxxxxxxxxxxxxxxxxx
Create a new strongly typed DataSet. Call it "StateStuffDS" (or
whatever you want to call it, try to avoid ambiguity)
Add 2 tables (with the columns)
State
StateID (int)
StateName (string)
StateAbbreviation (string)
StateRule
StateRuleID (int)
StateRuleText (string)
If the same rule can be used with multi states, create a link table.
StateToStateRule (table)
StateID (int)
StateRuleID (int)
Then famaliarize yourself with the
DataSet.WriteXml (or is it Write?)
DataSet.MyTable.Select
DataSet.Read ("c:\myfile.xml") (or is it ReadXml?)
methods.
Here is some psedu code.
StateStuffDS ds = new StateStuffDS();
ds.State.AddNewStateRow( 101, "Virginia", "VA");
ds.StateRule.AddNewStateRule ( 1001, "Is For Lovers" );
ds.StateToStateRule.AddStateToStateRule( 101, 1001);
ds.WriteXml (@"C:\myds.xml");
........................
StateStuffDS anotherDS = new StateStuffDS();
anotherDS.Read("C:\myds.xml");
DataRows[] foundRows = ds.State.Select("StateAbbreviation = 'VA'");
Good luck!
"Mike" <whyyoulookingatme@xxxxxxxxx> wrote in message
news:eao4Axj9IHA.4492@xxxxxxxxxxxxxxxxxxxxxxx
I have a dropdown with states on my web form, when a user selects a state
I need to show rules for that state. There are times that the rules may
be modified, so what I want to do is have all of my state rules in an XML
file (I don't see a need for a database for state rules) and allow the
user to show the rules for the state they select in the drop down and
also give a group of users the ability to update the XML files for states
that the rules that have changed. Is there a way to do this?
so I have
state drop down
user select a state a rules show for that state
on an 'update' page, a user can update a set of rules for 1 or all
states. I will have the update page have a state drop down so the user
cannot update all states at once.
.
- References:
- can this be done
- From: Mike
- Re: can this be done
- From: sloan
- Re: can this be done
- From: Mike
- can this be done
- Prev by Date: Re: can this be done
- Next by Date: Client Side Confirm
- Previous by thread: Re: can this be done
- Next by thread: Client Side Confirm
- Index(es):
Relevant Pages
|