You must Sign In to post a response.
  • Category: Webservices

    Webservice method does not return a value

    In my web service method does not return values in the browser its shows the error
    in the browser like An Error occurred while processing output information.

    My webservice method as below:

    public string GetItemCategory(string strDate)
    DataSet ds = new DataSet();
    string strDetails = "";
    if (ds.Tables[0].Rows.Count > 0)
    strDetails += "[";
    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
    strDetails += "{\"Field1\":\"" + ds.Tables[0].Rows[i]["ID"].ToString() + "\", \"Field2\":\"" + ds.Tables[0].Rows[i]["CategoryName"].ToString() + "\",\"Field3\":\"" + ds.Tables[0].Rows[i]["Active"].ToString() + "\",\"Field4\":\"" + ds.Tables[0].Rows[i]["Categorycode"].ToString() + "\"},";
    strDetails += "]";
    strDetails = strDetails.Replace(",]", "]");

    return strDetails;


    What's wrong in my webservice code i want to return the data from dataset to string.

    Could any body help me.

    Thank and Regards
  • #762150

    In your code i tried from C# working Good

    try this code

    string ff = obj.GetItemCategory("Test");

    But you mention from browser did you call json Get?

    Can you share the code

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #762158

    Hi Brite,

    The below code is first 3lines of your code part.

    DataSet ds = new DataSet();
    string strDetails = "";
    if (ds.Tables[0].Rows.Count > 0)

    In the above code where did you get data from database.

    In your case DataSet is null, but in your 3rd line you are checking table0 rows count.

    Hoe it is possible..?

    There is no tables in dataset then how you find table[0] and then rows of that.

    So, before that check the below condition too.

    if(ds.Tables.Count>0 && ds.Tables[0].Rows.Count>0)
    //do your stuff here.

    If you want to know the exact issue, put a breakpoint and check line by line.

    Hope this will helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #762172

    Are you filling the data set with data before performing operations on data set ds?

    Put break point and check till where you coding is carrying data.

    Directly check in wsdl file of webservice once by clicking the method you are calling.


    Sridhar Thota.

    Sridhar Thota.
    Editor: DNS Forum.

  • Sign In to post your comments