?
Solved

need to convert QueryStringParameter from string to int64

Posted on 2011-03-10
2
Medium Priority
?
677 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

777 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