Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 234169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:09:47+00:00 2026-05-11T20:09:47+00:00

Hello guys, I have an error I cannot solve, on a ASP.NET website. One

  • 0

Hello guys,

I have an error I cannot solve, on a ASP.NET website.

One of its pages – Countries.aspx, has the following controls:

  • a CheckBox called “CheckBoxNAME”:

< asp:CheckBox ID="CheckBoxNAME" runat="server" Text="Name" /> 
  • a TextBox called “TextBoxName”:

< asp:TextBox ID="TextBoxNAME" runat="server" Width="100%" Wrap="False"> < /asp:TextBox> 
  • a SQLDataSource called “SqlDataSourceCOUNTRIES”, that selects all records from a Table with 3 columns – ID (Number, PK), NAME (Varchar2(1000)), and POPULATION (Number) called COUNTRIES

< asp:SqlDataSource 
    ID="SqlDataSourceCOUNTRIES" 
    runat="server" 
    ConnectionString="< %$ ConnectionStrings:myDB %> " 
    ProviderName="< %$ ConnectionStrings:myDB.ProviderName %> " 
    SelectCommand="SELECT COUNTRIES.ID, COUNTRIES.NAME, COUNTRIES.POPULATION FROM COUNTRIES ORDER BY COUNTRIES.NAME, COUNTRIES.ID"> 
< /asp:SqlDataSource> 
 
  • a GridView called GridViewCOUNTRIES:

< asp:GridView 
    ID="GridViewCOUNTRIES" 
    runat="server" 
    AllowPaging="True" 
    AllowSorting="True" 
    AutoGenerateColumns="False" 
    DataSourceID="SqlDataSourceCOUNTRIES" 
    DataKeyNames="ID" 
    DataMember="DefaultView">  
    < Columns> 
        < asp:CommandField ShowSelectButton="True" /> 
        < asp:BoundField DataField="ID" HeaderText="Id" SortExpression="ID" /> 
        < asp:BoundField DataField="NAME" HeaderText="Name" SortExpression="NAME" /> 
        < asp:BoundField DataField="POPULATION" HeaderText="Population" SortExpression="POPULATION" /> 
    < /Columns> 
< /asp:GridView> 
  • a Button called ButtonFilter:

< asp:Button ID="ButtonFilter" runat="server" Text="Filter" onclick="ButtonFilter_Click"/> 

This is the onclick event:


    protected void ButtonFilter_Click(object sender, EventArgs e)
    {
        Response.Redirect("Countries.aspx?" + 
            (this.CheckBoxNAME.Checked ? string.Format("NAME={0}", this.TextBoxNAME.Text) : string.Empty));
    }

Also, this is the main onload event of the page:


    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack == false)
        {   
            if (Request.QueryString.Count != 0)
            {
                Dictionary parameters = new Dictionary();
                string commandTextFormat = string.Empty;

                if (Request.QueryString["NAME"] != null)
                {
                    if (commandTextFormat != string.Empty && commandTextFormat.EndsWith("AND") == false)
                    {
                        commandTextFormat += "AND";
                    }
                    commandTextFormat += " (UPPER(COUNTRIES.NAME) LIKE '%' || :NAME || '%') ";
                    parameters.Add("NAME", Request.QueryString["NAME"].ToString());
                }

                this.SqlDataSourceCOUNTRIES.SelectCommand = string.Format("SELECT COUNTRIES.ID, COUNTRIES.NAME, COUNTRIES.POPULATION FROM COUNTRIES WHERE {0} ORDER BY COUNTRIES.NAME, COUNTRIES.ID", commandTextFormat);

                foreach (KeyValuePair parameter in parameters)
                {
                    this.SqlDataSourceCOUNTRIES.SelectParameters.Add(parameter.Key, parameter.Value.ToUpper());
                }
            }
        }
    }

Basicly, the page displays in the GridViewCOUNTRIES all the records of table COUNTRIES.

The scenario is the following:
– the user checks the CheckBox;
– the user types a value in the TextBox (let’s say “ch”);
– the user presses the Button;
– the page loads displaying only the records that match the filter criteria (in this case, all the countries that have names containing “Ch”);
– the user clicks on the header of the column called “Name” in order to sort the data in the GridView

Then, I get the following error: ORA-01036: illegal variable name/number.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/number

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Any help is greatly appreciated, tnks.

PS: I’m using ASP.NET 3.5, under Visual Studio 2008, with an OracleXE database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:09:47+00:00Added an answer on May 11, 2026 at 8:09 pm

    The problem was an error in the SelectCommand of the SqlDataSource… Pretty lame…
    If anyone would like to find out about it in full details, contact me. Other wise, I’ll move on something else right now.

    This question can be considered answered, from my point of view, and closed.

    Thanks anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 200k
  • Answers 200k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One workaround would be the Apache Java POI library --… May 12, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer This actually works as it alerts the correct value: <html>… May 12, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer You can do this using a rolling hash in O(n)… May 12, 2026 at 8:02 pm

Related Questions

Hey guys, I have a problem (again). This time I am trying to use
I am playing around with Sharepoint 2007. I have a virtual machine (win server
It's me again guys, I have a small problem: // Create new PDF $pdf
I'm trying to use jQuery and JSON with a C# Web Service that I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.