G
Ginny
Hi,
I have a simple web service that returns a dataset. Its very simple. i call
the web service from a windows app. it works abosolutely fine when i can the
web service method synchronously. but when i try to call the method
asynchronosuly using the 'beginxxx' and 'endxxxx' it does not give any error
but at the same time, the datagrid on the form does not show any data as
well. the only code in my windows form is menitoned below. Kindly if some
one can assist.
private void button1_Click(object sender, System.EventArgs e)
{
Asynch.Service1 obj = new Asynch.Service1();
AsyncCallback cb = new AsyncCallback(callback);
obj.BeginGetDataAll(cb,obj);
}
private void callback(IAsyncResult ar)
{
Asynch.Service1 obj = (Asynch.Service1)ar.AsyncState;
DataSet ds = obj.EndGetDataAll(ar); // I have tried type casting also
here but still does not work --- DataSet ds =
(DataSet)obj.EndGetDataAll(ar);
dataGrid1.DataSource = ds.Tables[0];
}
I have a simple web service that returns a dataset. Its very simple. i call
the web service from a windows app. it works abosolutely fine when i can the
web service method synchronously. but when i try to call the method
asynchronosuly using the 'beginxxx' and 'endxxxx' it does not give any error
but at the same time, the datagrid on the form does not show any data as
well. the only code in my windows form is menitoned below. Kindly if some
one can assist.
private void button1_Click(object sender, System.EventArgs e)
{
Asynch.Service1 obj = new Asynch.Service1();
AsyncCallback cb = new AsyncCallback(callback);
obj.BeginGetDataAll(cb,obj);
}
private void callback(IAsyncResult ar)
{
Asynch.Service1 obj = (Asynch.Service1)ar.AsyncState;
DataSet ds = obj.EndGetDataAll(ar); // I have tried type casting also
here but still does not work --- DataSet ds =
(DataSet)obj.EndGetDataAll(ar);
dataGrid1.DataSource = ds.Tables[0];
}