how to get the web service response into grid view in C#
I am new to web services.
I want to display the response of web service into a GridView in my aspx file.
开发者_如何学JAVAHow is this possible?
Well, the first step would be to create a client proxy and invoke the service and the second step would be to point the DataSource property of the GridView to the collection you want to bind to. The final step is to call the DataBind method.
Example:
protected void Page_Load(object sender, EventArgs e)
{
using (var proxy = new WebServiceClientProxy())
{
SomeModel[] data = proxy.GetData();
gridView1.DataSource = data;
gridView1.DataBind();
}
}
精彩评论