E
enantiomer
Hey there. I have ported my business services project over to the CF.
All of my services use a dataReader to fill the business objects. In
porting over, however, I have noticed that reading data from the
SqlDataReader is very slow. I am not doing anything fancy. I create
my connection, command and execute a SqlDataReader.
As I loop through the result set and am reading column values, the
actualy reading of the column value seems to be the bottleneck. It was
taking over a second just to read a column value! Could this be an
issue with round trip time? I thought that when you call Read() from
your datareader, it puts the entire row into memory.
below is the read part that is taking forever. Anyone use a
SqlDataReader running on a compact framework device? My device is an
hp iPAQ... it's supposed to be pretty fast.
if (dataReader["DoDCageCode"] != DBNull.Value)
supplier.DoDCageCode = (string)dataReader["DoDCageCode"];
if (dataReader["EanUccCompanyPrefix"] != DBNull.Value)
supplier.EanUccCompanyPrefix =
(string)dataReader["EanUccCompanyPrefix"];
I experimented with just assigning the dataReader values to strings and
it is still just as slow. Do mobile devices have less networking
bandwidth on them? Any clues?
Thanks,
Jonathan
All of my services use a dataReader to fill the business objects. In
porting over, however, I have noticed that reading data from the
SqlDataReader is very slow. I am not doing anything fancy. I create
my connection, command and execute a SqlDataReader.
As I loop through the result set and am reading column values, the
actualy reading of the column value seems to be the bottleneck. It was
taking over a second just to read a column value! Could this be an
issue with round trip time? I thought that when you call Read() from
your datareader, it puts the entire row into memory.
below is the read part that is taking forever. Anyone use a
SqlDataReader running on a compact framework device? My device is an
hp iPAQ... it's supposed to be pretty fast.
if (dataReader["DoDCageCode"] != DBNull.Value)
supplier.DoDCageCode = (string)dataReader["DoDCageCode"];
if (dataReader["EanUccCompanyPrefix"] != DBNull.Value)
supplier.EanUccCompanyPrefix =
(string)dataReader["EanUccCompanyPrefix"];
I experimented with just assigning the dataReader values to strings and
it is still just as slow. Do mobile devices have less networking
bandwidth on them? Any clues?
Thanks,
Jonathan