Re: can this be done

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




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.









.



Relevant Pages

  • Re: TemplateField Buttons Ignoring OnClick Event
    ... The buttons get their settings from an XML file attached to an ... the RowCommand event of the GridView. ... protected void Page_Load(object sender, EventArgs e) ... int d = int.Parse); ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Expat, decision making on element-name
    ... "Maarten Verhage" in XML file). ... static void XMLCALL startElement(void *userData, const char *name, ... int *depthPtr = userData; ...
    (comp.lang.c)
  • map and BYTE[]
    ... I need to parse a XML file that describes a smart card file structure ... CDataIndex(int nSFID, int nRecNo, int nOffset, int size) { ...
    (comp.lang.cpp)
  • Re: question about datasets that get empty
    ... > When I click on Button1 than I load an xml file in a dataset. ... > private void Button1_Click(object sender, ... > int i = AdressenDataSet.Tables.Rows.Count; ...
    (microsoft.public.dotnet.framework.adonet)
  • Write to an XML file using data from an SQLserver table
    ... I wonder if I can write to an XML file using column structure (and column ... names) of an SQLserver table. ...
    (microsoft.public.dotnet.languages.vb)