can this be done

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    can this be done

    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.



  • sloan

    #2
    Re: can this be done


    Create a new strongly typed DataSet. Call it "StateStuff DS" (or whatever
    you want to call it, try to avoid ambiguity)

    Add 2 tables (with the columns)

    State
    StateID (int)
    StateName (string)
    StateAbbreviati on (string)

    StateRule
    StateRuleID (int)
    StateRuleText (string)


    If the same rule can be used with multi states, create a link table.

    StateToStateRul e (table)
    StateID (int)
    StateRuleID (int)




    Then famaliarize yourself with the

    DataSet.WriteXm l (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.AddNew StateRow( 101, "Virginia", "VA");

    ds.StateRule.Ad dNewStateRule ( 1001, "Is For Lovers" );

    ds.StateToState Rule.AddStateTo StateRule( 101, 1001);

    ds.WriteXml (@"C:\myds.xml" );

    ............... ..........

    StateStuffDS anotherDS = new StateStuffDS();
    anotherDS.Read( "C:\myds.xm l");

    DataRows[] foundRows = ds.State.Select ("StateAbbrevia tion = 'VA'");



    Good luck!



    "Mike" <whyyoulookinga tme@gmail.comwr ote in message
    news:eao4Axj9IH A.4492@TK2MSFTN GP03.phx.gbl...
    >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.
    >
    >
    >

    Comment

    • Mike

      #3
      Re: can this be done

      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@ipass.ne twrote in message
      news:uJqhbAk9IH A.3648@TK2MSFTN GP03.phx.gbl...
      >
      Create a new strongly typed DataSet. Call it "StateStuff DS" (or whatever
      you want to call it, try to avoid ambiguity)
      >
      Add 2 tables (with the columns)
      >
      State
      StateID (int)
      StateName (string)
      StateAbbreviati on (string)
      >
      StateRule
      StateRuleID (int)
      StateRuleText (string)
      >
      >
      If the same rule can be used with multi states, create a link table.
      >
      StateToStateRul e (table)
      StateID (int)
      StateRuleID (int)
      >
      >
      >
      >
      Then famaliarize yourself with the
      >
      DataSet.WriteXm l (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.AddNew StateRow( 101, "Virginia", "VA");
      >
      ds.StateRule.Ad dNewStateRule ( 1001, "Is For Lovers" );
      >
      ds.StateToState Rule.AddStateTo StateRule( 101, 1001);
      >
      ds.WriteXml (@"C:\myds.xml" );
      >
      ............... .........
      >
      StateStuffDS anotherDS = new StateStuffDS();
      anotherDS.Read( "C:\myds.xm l");
      >
      DataRows[] foundRows = ds.State.Select ("StateAbbrevia tion = 'VA'");
      >
      >
      >
      Good luck!
      >
      >
      >
      "Mike" <whyyoulookinga tme@gmail.comwr ote in message
      news:eao4Axj9IH A.4492@TK2MSFTN GP03.phx.gbl...
      >>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.
      >>
      >>
      >>
      >
      >

      Comment

      • sloan

        #4
        Re: can this be done


        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.space s.live.com/Blog/cns!A68482B9628 A842A!148.entry






        "Mike" <whyyoulookinga tme@gmail.comwr ote in message
        news:uwtR0Fk9IH A.1192@TK2MSFTN GP05.phx.gbl...
        >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@ipass.ne twrote in message
        news:uJqhbAk9IH A.3648@TK2MSFTN GP03.phx.gbl...
        >>
        >Create a new strongly typed DataSet. Call it "StateStuff DS" (or
        >whatever you want to call it, try to avoid ambiguity)
        >>
        >Add 2 tables (with the columns)
        >>
        >State
        > StateID (int)
        > StateName (string)
        > StateAbbreviati on (string)
        >>
        >StateRule
        > StateRuleID (int)
        > StateRuleText (string)
        >>
        >>
        >If the same rule can be used with multi states, create a link table.
        >>
        >StateToStateRu le (table)
        >StateID (int)
        >StateRuleID (int)
        >>
        >>
        >>
        >>
        >Then famaliarize yourself with the
        >>
        >DataSet.WriteX ml (or is it Write?)
        >DataSet.MyTabl e.Select
        >DataSet.Read ("c:\myfile.xml ") (or is it ReadXml?)
        >>
        >methods.
        >>
        >>
        >Here is some psedu code.
        >>
        >>
        >StateStuffDS ds = new StateStuffDS();
        >>
        >ds.State.AddNe wStateRow( 101, "Virginia", "VA");
        >>
        >ds.StateRule.A ddNewStateRule ( 1001, "Is For Lovers" );
        >>
        >ds.StateToStat eRule.AddStateT oStateRule( 101, 1001);
        >>
        >ds.WriteXml (@"C:\myds.xml" );
        >>
        >.............. ..........
        >>
        >StateStuffDS anotherDS = new StateStuffDS();
        >anotherDS.Read ("C:\myds.xml") ;
        >>
        >DataRows[] foundRows = ds.State.Select ("StateAbbrevia tion = 'VA'");
        >>
        >>
        >>
        >Good luck!
        >>
        >>
        >>
        >"Mike" <whyyoulookinga tme@gmail.comwr ote in message
        >news:eao4Axj9I HA.4492@TK2MSFT NGP03.phx.gbl.. .
        >>>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.
        >>>
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        Working...