无法将参数“SOHeadId”的值从“System.String”转换成“System.Guid”。
if (!IsPostBack)
{
if (PreviousPage != null)
{
if (PreviousPage.IsCrossPagePostBack)
{
ListBox lb = PreviousPage.Master.FindControl( "MainContent ").FindControl( "ListBox1 ") as ListBox;
ArrayList aryNumber = new ArrayList();
foreach (ListItem lt in lb.Items)
aryNumber.Add(lt.Value);
ObjectDataSource1.SelectParameters[ "SOHeadId "].DefaultValue = new ShareFunction().GetStringFromArrayList(aryNumber);
GridView1.DataBind();
}
}
else
{
}
}
SOHeadId 是GridView绑定时要的参数
------解决方案--------------------参数类型不匹配
需要的是System.Guid类型,而传入的却是String(GetStringFromArrayList(aryNumber))
应该是这个方法GetStringFromArrayList的返回类有误