Hi,

I have a server function that expects a string param and returns a
dataset.

[AjaxPro.AjaxMethod]
    public DataSet  getEvents(string cardno)
    {
        SqlConnection cn = new SqlConnection("Data
Source=euronet-server;initial catalog=euroMaster;user
id=sa;password=sa;");
        string sql = "select
eventdate,eventdescription,devicedescription,devchilddescription from
eurevents where eventid in (616,617) and subitemno= "+
int.Parse(cardno) + " order by eventdate desc ";
        SqlCommand cmd = new SqlCommand(sql);
        cmd.Connection = cn;
        cn.Open();
        SqlDataAdapter adapter = new SqlDataAdapter(cmd);
        DataSet dataSet = new DataSet();
        adapter.Fill(dataSet);
        cmd.Connection.Close();
        return dataSet;

    }

//Client side:
//(on click of the button)

function btn_onClick()
{
   ....
 _Default.getEvents(strCard,_callbackEvents)  //strvalue contains the
value
}

//Callback function
function _callbackEvents(evs)
    {

        var ds= new Ajax.Web.DataSet();
        ds= evs.value;
        if (ds!=null)
        {
          var cols = ds.Tables[0].Columns.length;
          var rows = ds.Tables[0].Rows.length;
          alert(cols + " cols and " + rows + " rows");
        }
        else
          alert("No events found");

    }

The server side is receiving the parameter and gets executed, but the
callback always gives a no events found message.
Please help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to