Here is the binding code:
private void Button2_Click(object sender, System.EventArgs e)
{
localhost.PubsWebService ms = new localhost.PubsWebService();
DataSet getTitles = ms.GetTitles(TextBox1.Text);
DataGrid DataGrid1 = new DataGrid();
DataGrid1.DataSource = getTitles.Tables;
DataGrid1.DataBind();
}
I know that it is returning a single result with my input because I can display it with:
private void Button2_Click(object sender, System.EventArgs e)
{
localhost.PubsWebService ms = new localhost.PubsWebService();
DataSet getTitles = ms.GetTitles(TextBox1.Text);
ListBox1.Items.Add(getTitles.Tables["Table"].Rows[0]["title"].ToString());
}
Is there something that I am missing in the databind?
----- William Ryan eMVP wrote: -----
Mike:
There shouldn't be any difference once the dataset is returned. Are you
calling DataGrid.DataBind after setting the datasource and have you
confirmed that you have rows? Can you post the code where you bind the
grid?
Mike said:
I am returning a dataset object from a web service method to a
subscribing
web form application. I create a dataset object and set the value equal to
the passed dataset. When I databind to a datagrid, nothing happens. I have
had luck doing this directly but not by passing the object from a web
service. Are there any examples of this? Is there anything special that I
need to do?