Fred Tededmondson

Fred Tededmondson

  • 2.1k
  • 12
  • 84.6k

Alter parameter type

Dec 9 2010 2:22 PM

Hi, all,
How does one go about setting the value type of a parameter built into a datatable/tableadapter query?  I usually create these by typing a ? (which it converts to :PARAM1, eg) into the query.  However, it tries to guess what type of value I mean to send, and it's guessing wrong.  It's using the field type it's getting from the database (Decimal), and while I guess I could convert the values to decimals, I would prefer string matching.  I don't like to convert integers to floating point numbers; I have lost a lot of time in the past to rounding errors.
 
So I'm wondering how you tell QueryBuilder what type of value you're passing.  I have gone into the Designer codebehind for the dataset and manually edited the code that builds in the parameter to match one that's a legitimate string, and this does work (as long as you close the design view first), but it seems like the sort of thing that the designer should let you control somehow (eg, type ?D or ?S)