When debugging the page i am getting error("argumentexception was unhandled by user code"). Can any one help me on this.

in .aspx page:
<asp:DropDownList ID="ddlCategoryID" runat="server" CssClass="input"> </asp:DropDownList>

in .aspx.cs page:

pageload :


        DataTable dt = new DataTable();
        using (OracleConnection Con = new OracleConnection("SConnectionString"))
            OracleCommand cmd = new OracleCommand("Select * from nts_advertisements", Con);
            OracleDataAdapter da = new OracleDataAdapter(cmd);
        ddlCategoryID.DataSource = dt;
        ddlCategoryID.DataTextField = "Category";
        ddlCategoryID.DataValueField = "Category";

Thanks in advance.

Kavitha Kesav

new OracleConnection("SConnectionString")

I think you need to pass an actual connection string.

using (OracleConnection Con = new OracleConnection("SConnectionString"))

you either need to supply the connection string there, or add the connection string to your web.config file and then reference the web.config when setting up your connections.

in web.config...

    <add name="connName" connectionString=" .. you fill this in ..."/>

in your code behind..

new OracleConnection(ConfigurationManager.ConnectionStrings["connName"].ConnectionString

Can you post the full Inner Exception text?