我webservice
在这个变量BookingDetailsEmailRS[]
bookingDetailsEmailRS 中收到航空公司的回复。
我想在嵌套数组中获取 Travelers 字段。
在我的网格视图旅行者姓名列中填写此字段。
protected void Button1_Click(object sender, EventArgs e)
{
GatewayBookingClient b = new GatewayBookingClient();
string emailid = "mshrivastava@fareportal.com";
string errorCode = string.Empty;
string errorAtNode = string.Empty;
SoapAuthentication soap = new SoapAuthentication();
soap.UserName = "peter@mobissimo.com";
soap.Password = "mob1ss1mo1947";
BookingDetailsEmailRS[] bookingDetailsEmailRS = b.GetBookingDetails(soap, emailid, out errorCode, out errorAtNode);
for (int i = 0; i < bookingDetailsEmailRS.Length - 1; i++)
{
GridView1.DataSource = bookingDetailsEmailRS;
GridView1.DataBind();
}
}
我成功地从数组中获取了值,但另一个问题是我想在网格的“TravellerName”列中绑定名称变量的每个值。“TravellerName”列在网格中创建了我自己的列。
string name = bookingDetailsEmailRS[i].Travelers[0].FirstName +
bookingDetailsEmailRS[i].Travelers[0].MiddleName +
bookingDetailsEmailRS[i].Travelers[0].LastName;