|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Non-mapped column set to NULL during Fill.I call myOleDbDataAdapter.Fill(myTypedDataset, "MyTableName"); after i set value of column not mentioned in DataAdapter. myTypedDataset.MyTable.Guid = Guid.NewGuid().ToString(); this column is not included into any key or relation. after i fill dataset again. myOleDbDataAdapter.Fill(myTypedDataset, "MyTableName"); and - my coulmn is set to NULL (DBNull.Value). How can I prevent this behavior? How can i store value in my column? Alex Kosov Alex,
Fill method will reset DataTable each time when you call it. Solution to it is to fill another dataset from the database and merge both using Merge method of the DataSet. During merge you could specify if you would like to preserve schema and what should be done with the missing data Show quote "Alex Kosov" <a*@msiminsk.com> wrote in message news:OYMqBsiLGHA.2604@TK2MSFTNGP09.phx.gbl... > Hello. > > I call > myOleDbDataAdapter.Fill(myTypedDataset, "MyTableName"); > > after i set value of column not mentioned in DataAdapter. > > myTypedDataset.MyTable.Guid = Guid.NewGuid().ToString(); > > this column is not included into any key or relation. > > after i fill dataset again. > > myOleDbDataAdapter.Fill(myTypedDataset, "MyTableName"); > > and - my coulmn is set to NULL (DBNull.Value). > > How can I prevent this behavior? How can i store value in my column? > > Alex Kosov > > |
|||||||||||||||||||||||