strange things with adonet 2.0 abstract DataObjects

E

Elhanan

hi...

i have a typed a dataset which i'm trying to load with data using
IDataAdapter:
IDbDataAdapter a = GetFactory().CreateDataAdapter();
a.SelectCommand = cmd;
RMDataSet ds = new RMDataSet();
a.Fill(ds);

problem is that instead of filling the table i wanted to fill, the
adapter creates ANOTHER table by the name of 'table' in the dataset.


further more if i try to use:
using (IDataReader reader = cmd.ExecuteReader())
{
dt.Load(reader);
reader.Close();
}

i get an exception on the load method becouse it says i'm trying to
vaiolate constraints, if i remove a allowDBnull =false from one of the
fields, it passes but that field HAS value
what's going on??
 
?

=?iso-8859-1?Q?Patrik=20L=f6wendahl=20[C#=20MVP]?=

Hello Elhanan,

For your first question, try this:

a.Fill(ds, "yourtablename");

Your second question sounds odd. Is it a string field with a dbnull default
value set on it? Or are you certain that the db holds a value for that field?
 
E

Elhanan

i can't a is iDataAdapter and it's fill method only has one argument


as for my second questions, it's a decimal field , becouse if i use the
read method just before the load method i see the value.
 
Top