[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 691
  • Last Modified:

need to convert QueryStringParameter from string to int64

I have a gridview that is bound to a objectdatasource(ods).  It uses this:
        <SelectParameters>
            <asp:QueryStringParameter Name="customerID" QueryStringField="ID"  Type="String" />
        </SelectParameters>

But here is the deal...the SelectMethod needs customerID to be an integer64 instead of a string.
After researching, I found that I need to do the conversion in the Selecting event of the ods.

So I added this line, but this isn't working because customerID remains as string after this line is executed:
Convert.ChangeType(e.InputParameters("customerID"), TypeCode.Int64)

Can someone please tell me what I need to do to change the datatype of the SelectParameter from string to int64?  Thank you!
0
ToolTimeGang
Asked:
ToolTimeGang
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
You should be able to simply set the Type for the querystring parameter and let it do the conversion itself:
<asp:QueryStringParameter Name="customerID" QueryStringField="ID"  Type="Int64" />

Open in new window

0
 
ToolTimeGangAuthor Commented:
Boy do I feel silly!  I should have tried that first!  Thanks.  I'm all set now!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now