AutoCompleteExtender and web service returning a dataset

Rate It (1)

Last post 08-02-2006 11:27 PM by Atlas Newbie. 7 replies.

Sort Posts:

  • AutoCompleteExtender and web service returning a dataset

    07-24-2006, 11:28 AM
    • Member
      18 point Member
    • DRotondo
    • Member since 07-24-2006, 3:17 PM
    • Posts 5

    Hey All,

    I am trying to use a textbox with an AutoCompleteExtender to take a string of letters and retreive a list of street names from a web service.  This web service works fine when it returns a dataset which I bind to a GridView.  However when I try to use the AutoCompleteExtender it just gives me:
    [object Object]

    Any help on what I need to do to resolve this would be appreciated.

    Thanks,

    Doug

    Here is the webservice code:

    [WebMethod]

    public DataSet GetStreetNames(string strStreetName)

    {

    OracleConnection myStrConnection = new OracleConnection();

    OracleCommand myStrCommand = new OracleCommand();

    OracleDataAdapter myStrAdapter = new OracleDataAdapter();

    DataSet myStrDataSet = new DataSet();

    myStrConnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnName"].ToString();

    myStrCommand.CommandText = "PackageNameIsHere";

    myStrCommand.CommandType = CommandType.StoredProcedure;

    myStrCommand.Parameters.Add("p_street_name", OracleDbType.Varchar2).Value = strStreetName;

    myStrCommand.Parameters["p_street_name"].Direction = ParameterDirection.Input;

    myStrCommand.Parameters.Add("cur_streets", OracleDbType.RefCursor);

    myStrCommand.Parameters["cur_streets"].Direction = ParameterDirection.Output;

    myStrCommand.Connection = myStrConnection;

    try

    {

    myStrConnection.Open();

    myStrAdapter.SelectCommand = myStrCommand;

    myStrAdapter.Fill(myStrDataSet);

    myStrConnection.Close();

    }

    catch (Exception ex)

    {

    throw ex;

    }

    finally

    {

    myStrConnection.Close();

    myStrConnection.Dispose();

    }

    return myStrDataSet;

    }

  • Re: AutoCompleteExtender and web service returning a dataset

    08-01-2006, 7:53 AM
    • Member
      25 point Member
    • Atlas Newbie
    • Member since 07-24-2006, 11:46 PM
    • Posts 5

    Hi,

    I have the problem other way round. I would be glad if you could help me.

    I have made a web service, from which I display the names in the text box using auto complete extender. That seems to work fine.

    But my problem is I dont seem to know how to bind the gridview with data. I would be greatful if you could help me on that.

    I am very new to Atlas and I would be really greatful if I could help you on anything, which I dont think would be much of a case. :D

    Thanks and Regards

  • Re: AutoCompleteExtender and web service returning a dataset

    08-01-2006, 2:13 PM
    • Contributor
      3,846 point Contributor
    • rchern13
    • Member since 07-14-2005, 12:52 PM
    • Saint Louis
    • Posts 829
    The webservice used with AutoCompleteExtender can only return an array of strings.  This is a limitation of the way the extender was written.  Please search for my post about a Custom AutoCompleteExtender - I'm posting that code later today.
    HTH, rchern.

    Churned Ajax Toolkit

    Please choose "Mark as Answer" for the posts that lead you to a solution.
  • Re: AutoCompleteExtender and web service returning a dataset

    08-01-2006, 11:22 PM
    • Member
      25 point Member
    • Atlas Newbie
    • Member since 07-24-2006, 11:46 PM
    • Posts 5

    Hi,

    Thanks a lot for replying to the post. I completely agree with you that the service used with Auto complete extender returns an array of strings.

    I would be surely waiting for your example as to how you are doing the things you said. I am also amazed why Atlas dev team didnt think for that.

    Actually my original post was based on the first post made by DRotondo, wherein he has mentioned that His web service returns a dataset which is then directly bound to the Gridview. I was confused, because I am not sure whether it can be done or not?

    Please share your thoughts on that too.

    Thanks and regards.

  • Re: AutoCompleteExtender and web service returning a dataset

    08-01-2006, 11:36 PM
    • Contributor
      3,846 point Contributor
    • rchern13
    • Member since 07-14-2005, 12:52 PM
    • Saint Louis
    • Posts 829
    You can use Atlas to call a webservice from javascript and it can return whatever you want.  This is what I do in my custom AutoCompleteExtender.  If it wasn't possible I wouldn't be able to do it for my ACE. ;)

    I'm not sure what you're asking for.
    HTH, rchern.

    Churned Ajax Toolkit

    Please choose "Mark as Answer" for the posts that lead you to a solution.
  • Re: AutoCompleteExtender and web service returning a dataset

    08-02-2006, 9:29 AM
    • Member
      25 point Member
    • Atlas Newbie
    • Member since 07-24-2006, 11:46 PM
    • Posts 5

    Thanks for the reply,

    I got everything about the Auto complete extender. It is working fine for me.

    My problem is,

    Can I use Atlas to call webservice from javascript, which returns a dataset and then bind it to a GridView control?

    I dont personally think this is possible directly from javascript. Please let me know if you have a solution.

    Thanks and regards,

  • Re: AutoCompleteExtender and web service returning a dataset

    08-02-2006, 10:09 AM
    • Contributor
      6,606 point Contributor
    • paul.vencill
    • Member since 02-01-2006, 7:57 AM
    • Gaithersburg, MD
    • Posts 1,348

    I havne't tried this, but I suspect that you'd have an aweful lot of custom coding to get this to work.  What's at issue is the fact that a Gridview is rendered server-side, and javascript happens client-side.  So to do what you're describing, you'd have to have your javascript update the cells of the html table that the Gridview renders on the client as... not a fun task, imo.

    Your options, I think, are to use an atlas-native databound control (e.g. ListView) or else bind your data server-side against the Gridview.  that's not to say that you can't consume a web service in either case, you just have to do it where appropriate (so, possibly consume the web service on your server as part of your data access layer).

    Help those who have helped you... remember to "Mark as Answered"
  • Re: AutoCompleteExtender and web service returning a dataset

    08-02-2006, 11:27 PM
    • Member
      25 point Member
    • Atlas Newbie
    • Member since 07-24-2006, 11:46 PM
    • Posts 5

    Hi,

    Thanks for the reply... But I was of the same view for what you have mentioned. I tried a lot but as you rightly said, it is fundamentally not possible. But it was just that I read the first post and thought that DRotondo was doing otherwise. So I got confused and raised the question.

    By the way I have tried both the methods mentioned by you,

    1) Getting web service data from the server side and populating the grid view

    2) Getting data from web service using Javascript and then using Atlas List View

    Both these methods work perfectly fine. Smile

    Thanks

Page 1 of 1 (8 items)