jwite2003
04-25-2003, 04:01 PM
Hi...
I'm having problems trying to change a row in a dataset and then update the database with the DataAdapter.Update(dataset,datatable source).
In a namespace called "junk", I created a dataset called "DSPlay". I than created "dsPlay1" as an instantiation of DSPlay. In "DSPlay" I have only one datatable called "Snafu".
I next tried to create a DataRow called "ChangeRow" using "junk.DSPLAY.SnafuRow ChangeRow". Following this I tried to instantiate and initialize it with "ChangeRow = dsPlay1.Snafu.FindBySnafuID(1);"
I then tried to change an element in the datarow: "ChangeRow.SnafuName="bla";". This is the line of code which throws an error at run time, saying that ChangeRow has not been instantiated.
I tried directly instantiating ChangeRow with: ChangeRow = new junk.DSPlay.SnafuRow(System.Data.DataRowBuilder drb);
But then it wouldn't allow me to instantiate drb as an instance of DataRowBuilder. It tells me that DataRowBuilder objects can only be instantiated internally.
Has anyone else had this problem, or know how to fix it?
Thanks,
I'm having problems trying to change a row in a dataset and then update the database with the DataAdapter.Update(dataset,datatable source).
In a namespace called "junk", I created a dataset called "DSPlay". I than created "dsPlay1" as an instantiation of DSPlay. In "DSPlay" I have only one datatable called "Snafu".
I next tried to create a DataRow called "ChangeRow" using "junk.DSPLAY.SnafuRow ChangeRow". Following this I tried to instantiate and initialize it with "ChangeRow = dsPlay1.Snafu.FindBySnafuID(1);"
I then tried to change an element in the datarow: "ChangeRow.SnafuName="bla";". This is the line of code which throws an error at run time, saying that ChangeRow has not been instantiated.
I tried directly instantiating ChangeRow with: ChangeRow = new junk.DSPlay.SnafuRow(System.Data.DataRowBuilder drb);
But then it wouldn't allow me to instantiate drb as an instance of DataRowBuilder. It tells me that DataRowBuilder objects can only be instantiated internally.
Has anyone else had this problem, or know how to fix it?
Thanks,