Solved

need to convert QueryStringParameter from string to int64

Posted on 2011-03-10
2
662 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

733 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