1 回答
TA贡献1818条经验 获得超8个赞
一些变化:
private void button5_Click(object sender, EventArgs e)
{
newAccountSearchByBVN.Customer cs; //no need to create new object, you'll be receiving it from server
newAccountSearchByBVN.FetchInformationBVNService nacc = new newAccountSearchByBVN.FetchInformationBVNService();
cs = nacc.GetCustomerNameWithBVN(bvn_search.Text); //instead of saving your Customer to string, save it to cs variable you already
if (cs != null) //check if you've received object, it's not null
{
//order was wrong. You want to populate text boxes, and you were taking data from text boxes here...
fullname.Text = cs.fullname;
address.Text = cs.address;
city.Text = cs.city;
state.Text = cs.state;
id_type.Text = cs.id_type;
id_number.Text = cs.id_number;
}
}
附加提示,您应该考虑为正确的数据使用正确的类型。例如(id_type并且id_number不应该是string,但是int)
- 1 回答
- 0 关注
- 194 浏览
添加回答
举报