Refresh update, select, and insert command parameter lengths in a dataadapter...

  • Thread starter Thread starter hyper_x_43
  • Start date Start date
H

hyper_x_43

Hey guys,

I have this column 'ShipmentEmail'. Its 80 characters... So, all the
ins, upd, and sel commands have this parameter with length 80 chars.

The user says 'Bump the length of this field up dammit...', so I go and
change it to 255 in the DB. That goes fine without any incidents.

Now, the parameters in the sel, ins, and upd commands still have the
old length of 80. How do I ask it to refresh the length of the
parameters whenever you do an ins, upd, or sel??
Thanks for the help.

HyperX.
 
You may want to use the DeriveParameters method of the CommandBuilder - you
can also check out the Microsoft Data Access Application Block which will
handle this for you.
 
Ryan, thanks for the reply.

I downloaded the v2 of DataAccess application block, and i cannot find
any method either in the sqlhelper or SqlHelperParameterCache class...

I tried couple of methods and classes including SqlHelperParameterCache
which works only for Stored Procedures.

I'm looking for something that takes in the adapter and refreshes the
parameter details including the length of the columns based on the
selected columns in the select command of the adapter..

Which method does this for me? Can you please help me resolve this
issue?

Thanks,

HyperX.
 
Sure - if you need to most up to date paramater info - rerun
DeriveParameters - that will give it to you. The reason it's cached in the
block (I assume) is b/c that information is relatively static and not likely
to change during any given session - but like everything in the disconnected
scenario - it's only as good as the info the last time it checked. Just
pump through a new select command and use the DeriveParameters - that should
get it for you.,
 
Ryan,

That DAAB works for Stored Procedures though...

I have lots and lots of adapters which DO NOT use SPs.

I need a method that works for an Adapter with NO stored procedures.

HyperX.
 
Back
Top