This is a multi-part message in MIME format.

------=_NextPart_000_0204_01C47431.D406C710
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hi,

I have the following code, which should allow me to only show a certain =
number of items in a listbox:

DataView dv =3D new DataView(dataSet1.Tables[ISSUE_TYPE_TABLE], =
"IssueAreaDesc=3D'" + txt + "'","",DataViewRowState.ModifiedCurrent);
types.DataSource =3D dv.Table;
types.DisplayMember =3D "Issue Type";
types.DataMember =3D "IssueType";
types.ValueMember =3D "IssueTypeDesc";
types.DataBind();

Instead, my listbox does contain the full table's data. Any idea what =
might be wrong?

Thanks
Mike


------=_NextPart_000_0204_01C47431.D406C710
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.3790.118" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have the following code, which should =
allow me to=20
only show a certain number of items in a listbox:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>
<P>&nbsp;&nbsp;&nbsp; DataView dv =3D </FONT><FONT color=3D#0000ff=20
size=3D2>new</FONT><FONT size=3D2> =
DataView(dataSet1.Tables[ISSUE_TYPE_TABLE],=20
"IssueAreaDesc=3D'" + txt +=20
"'","",DataViewRowState.ModifiedCurrent);<BR>&nbsp;&nbsp;&nbsp; =
types.DataSource=20
=3D dv.Table;<BR>&nbsp;&nbsp;&nbsp; types.DisplayMember =3D "Issue=20
Type";<BR>&nbsp;&nbsp;&nbsp; types.DataMember =3D=20
"IssueType";<BR>&nbsp;&nbsp;&nbsp; types.ValueMember =3D=20
"IssueTypeDesc";<BR>&nbsp;&nbsp;&nbsp; =
types.DataBind();</P></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Instead, my listbox does contain the =
full table's=20
data. Any idea what might be wrong?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Mike</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0204_01C47431.D406C710--

Re: DataView RowFilter by Miha

Miha
Tue Jul 27 17:27:45 CDT 2004

This is a multi-part message in MIME format.

------=_NextPart_000_0041_01C47439.B4250760
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Mike,
"Mike" <nospam@nospam.com> wrote in message =
news:uYVgSFCdEHA.596@TK2MSFTNGP11.phx.gbl...

Hi,

I have the following code, which should allow me to only show a =
certain number of items in a listbox:

DataView dv =3D new DataView(dataSet1.Tables[ISSUE_TYPE_TABLE], =
"IssueAreaDesc=3D'" + txt + "'","",DataViewRowState.ModifiedCurrent);
types.DataSource =3D dv.Table;

You should bind to dv and not to underlying table. Correct code would =
be:
types.DataSource =3D dv;


--=20
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com


types.DisplayMember =3D "Issue Type";
types.DataMember =3D "IssueType";
types.ValueMember =3D "IssueTypeDesc";
types.DataBind();

Instead, my listbox does contain the full table's data. Any idea what =
might be wrong?

Thanks
Mike


------=_NextPart_000_0041_01C47439.B4250760
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Mike,</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Mike" &lt;<A =
href=3D"mailto:nospam@nospam.com">nospam@nospam.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:uYVgSFCdEHA.596@TK2MSFTNGP11.phx.gbl">news:uYVgSFCdEHA.596@T=
K2MSFTNGP11.phx.gbl</A>...</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have the following code, which =
should allow me=20
to only show a certain number of items in a listbox:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>
<P>&nbsp;&nbsp;&nbsp; DataView dv =3D </FONT><FONT color=3D#0000ff=20
size=3D2>new</FONT><FONT size=3D2> =
DataView(dataSet1.Tables[ISSUE_TYPE_TABLE],=20
"IssueAreaDesc=3D'" + txt +=20
"'","",DataViewRowState.ModifiedCurrent);<BR>&nbsp;&nbsp;&nbsp;=20
types.DataSource =3D dv.Table;</FONT></P><FONT =
size=3D2></FONT></DIV><FONT=20
size=3D2></FONT></BLOCKQUOTE>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><FONT=20
size=3D2><FONT face=3DArial>You should bind to dv and not to =
underlying table.=20
Correct code would be:</FONT></FONT></BLOCKQUOTE>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><FONT=20
size=3D2>
<P>&nbsp;&nbsp;&nbsp; types.DataSource =3D dv;</P>
<P><FONT face=3DArial><BR>-- <BR>Miha Markic [MVP C#] - RightHand .NET =

consulting &amp; development<BR>miha at rthand com<BR><A=20
href=3D"http://www.rthand.com">www.rthand.com</A></FONT></P>
<P><FONT face=3DArial></FONT><FONT =
face=3DArial></FONT><BR>&nbsp;&nbsp;&nbsp;=20
types.DisplayMember =3D "Issue Type";<BR>&nbsp;&nbsp;&nbsp; =
types.DataMember =3D=20
"IssueType";<BR>&nbsp;&nbsp;&nbsp; types.ValueMember =3D=20
"IssueTypeDesc";<BR>&nbsp;&nbsp;&nbsp; types.DataBind();</P></FONT>
<DIV><FONT face=3DArial size=3D2>Instead, my listbox does contain the =
full table's=20
data. Any idea what might be wrong?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Mike</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0041_01C47439.B4250760--