PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Non-mapped column set to NULL during Fill.
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Non-mapped column set to NULL during Fill.
![]() |
Non-mapped column set to NULL during Fill. |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 -- Val Mazur Microsoft MVP http://xport.mvps.org "Alex Kosov" <ak@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 > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thank you very much, Val, for your help.
Alex |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

