Method Error 500

  • aspx form:

    Category: <asp:DropDownList ID="ddlCategory"

    runat="server" />

    <ajaxToolkit:CascadingDropDown

    ID="CascadingDropDown1"

    runat="server"

    TargetControlID="ddlCategory"

    Category="category"

    PromptText="Select a Category"

    LoadingText="[Loading Category...]"

    ServicePath="AutoComplete.asmx"

    ServiceMethod="GetCategory" />

    Webservice file:

    [WebService(Namespace = "http://tempuri.org/")]

    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

    [System.Web.Script.Services.ScriptService]

    public class AutoComplete : System.Web.Services.WebService

    {

    [WebMethod]

    [System.Web.Script.Services.ScriptMethod()]

    public CascadingDropDownNameValue[] GetCategory(string knownCategoryValues, string category)

    {

    SqlConnection conn = new SqlConnection("server=localhost;database=blankphed;user id=sa;password=nicnet10");

    conn.Open();

    SqlCommand comm = new SqlCommand("SELECT categoryname,categoryid from ContractorCategory", conn);

    SqlDataReader dr = comm.ExecuteReader();

    List ();

    try

    {

    while (dr.Read())

    {

    string name = (string)dr["categoryname"];

    int id = (int)dr["categoryid"];

    value.Add(new CascadingDropDownNameValue(name, id.ToString()));

    }

    }

    catch { }

    finally

    {

    conn.Close();

    }

    return value.ToArray();

    }

    }

    When i run it ,it lead to a problem in the combobox method error 500 .What i have to do.

  • It does not seem to be a database server issue. Here is link. May it help.

    http://www.mrexcel.com/archive2/38800/44953.htm

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply