Solved

need to convert QueryStringParameter from string to int64

Posted on 2011-03-10
2
670 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

696 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