Solved

need to convert QueryStringParameter from string to int64

Posted on 2011-03-10
2
642 Views
Last Modified: 2012-05-11
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
Comment
Question by:ToolTimeGang
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 35094981
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
 

Author Comment

by:ToolTimeGang
ID: 35096743
Boy do I feel silly!  I should have tried that first!  Thanks.  I'm all set now!!!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now