About the RowFilter in DataView .

  • Thread starter Thread starter kylin
  • Start date Start date
K

kylin

view=myDal.LoadAll().Tables[SortData.SORT_TABLE].DefaultView;
//view.RowFilter="ParentID="+int.Parse(ddlSort.SelectedValue.ToString());
view.RowFilter="ParentID=1"; //This Line is Ok !
dgSort.DataSource=view;
dgSort.DataBind();

Just like the notes ,
if I use "
view.RowFilter="ParentID="+int.Parse(ddlSort.SelectedValue.ToString()); "
errors
but "view.RowFilter="ParentID=1"; " is okey ?
why ?
 
Are you sure that ddlSort.SelectedValue is a numeric value?
What exactly does error?
What is the RowFilter string?
 
hey,Thanks !
I have solved this error!


Miha Markic said:
Are you sure that ddlSort.SelectedValue is a numeric value?
What exactly does error?
What is the RowFilter string?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

kylin said:
view=myDal.LoadAll().Tables[SortData.SORT_TABLE].DefaultView;
//view.RowFilter="ParentID="+int.Parse(ddlSort.SelectedValue.ToString());
view.RowFilter="ParentID=1"; //This Line is Ok !
dgSort.DataSource=view;
dgSort.DataBind();

Just like the notes ,
if I use "
view.RowFilter="ParentID="+int.Parse(ddlSort.SelectedValue.ToString()); "
errors
but "view.RowFilter="ParentID=1"; " is okey ?
why ?
 
Back
Top