There is another middle ground approach.
Create a strongl (-ly typed) dataset. And do it in memory.
Here is a crappy example I just wrote up for another person.
Sorry for the c# syntax, it'll convert easy.
Create a new strongly typed DataSet. Call it "StateStuffDS" (or whatever
you want to call it, try to avoid ambiguity)
Add 3 tables (with the columns)
State
StateID (int)
StateName (string)
StateAbbreviation (string)
StateRule
StateRuleID (int)
StateRuleText (string)
StateToStateRule
StateID (int)
StateRuleID (int)
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");
DataRow [] foundRows = ds.State.Select("StateAbbreviation = 'VA'");
//include the System.Data namespace
if(foundRows.Length > 0) //or is it .Count?
{
StateStuffDS.State.StateRow currentRow = foundRows[0] as
StateStuffDS.State.StateRow; //just a test to pop off the first row
if(null!= currentRow)
{
Console.Writeline (currentRow.StateName);
}
}
You get some strong typing this way, even in the DataSet model.
Good luck!
Brian said:
I want to create an In Memory dataset. not connected to any database..
but putting my own info in from code or a file....
What are the steps to do this? Where can I find some info on how to do
this?
Brian