This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C3546A.6FA5CFB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

=20

I have the following scenario:

=20

myDataSet.Tables("tblCustomer").Rows.Count =3D 4



This is quite fine as the table contains 4 rows. However=20



myDataSet.Tables("tblCustomer").DefaultView.Count =3D 1=20



is not exactly what I expected it to be (I thought the result should be =
4). Can anybody explain this behavior to me?



Thanks in advance



Daniel


------=_NextPart_000_0008_01C3546A.6FA5CFB0
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.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT=20
face=3DVerdana>Hi,<?xml:namespace prefix =3D o ns =3D=20
"urn:schemas-microsoft-com:office:office" =
/><o:p></o:p></FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><o:p><FONT face=3DVerdana=20
size=3D2>&nbsp;</FONT></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT face=3DVerdana>I =
have the=20
following scenario:<o:p></o:p></FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><o:p><FONT face=3DVerdana=20
size=3D2>&nbsp;</FONT></o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT face=3DVerdana size=3D2><FONT=20
face=3D"Courier New">myDataSet.Tables("tblCustomer").Rows.Count =3D=20
4</FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT face=3DVerdana=20
size=3D2></FONT></SPAN>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT =
face=3DVerdana>This is quite=20
fine as the table contains 4 rows. However </FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT=20
face=3DVerdana></FONT></FONT></SPAN>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT face=3D"Courier New"=20
size=3D2>myDataSet.Tables("tblCustomer").DefaultView.Count =3D&nbsp;1=20
</FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT=20
face=3DVerdana></FONT></FONT></SPAN>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT =
face=3DVerdana>is&nbsp;not=20
exactly what I expected it to be (I thought the result should be=20
4).&nbsp;</FONT></FONT></SPAN><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT =
face=3DVerdana>Can anybody=20
explain this behavior to me?</FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT=20
face=3DVerdana></FONT></FONT></SPAN>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT size=3D2><FONT =
face=3DVerdana>Thanks in=20
advance</FONT></FONT></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT face=3DVerdana=20
size=3D2></FONT></SPAN>&nbsp;</P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US=20
style=3D"mso-ansi-language: EN-US"><FONT face=3DVerdana =
size=3D2>&nbsp;&nbsp;=20
Daniel</FONT></SPAN></P></DIV></BODY></HTML>

------=_NextPart_000_0008_01C3546A.6FA5CFB0--

Re: DefaultView.Count always returns 1 by Carl

Carl
Sun Jul 27 15:10:50 CDT 2003

Daniel,
I get the same count when using the following code:

' Note I create the sqlConnection1 and sqlDataAdapter1
' by dragging a Table from Server Explorer onto the WinForm.
Dim ds As DataSet = New DataSet
SqlDataAdapter1.Fill(ds, "customers")

MsgBox("Rows.Count = " & ds.Tables("customers").Rows.Count)
MsgBox("DefaultView.RowFilter = " & ds.Tables("customers").DefaultView.RowFilter)
MsgBox("DefaultView.RowStateFilter = " & ds.Tables("customers").DefaultView.RowStateFilter.ToString())
MsgBox("DefaultView.Count = " & ds.Tables("customers").DefaultView.Count)

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com


"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote in message news:ehhn#8GVDHA.2316@TK2MSFTNGP09.phx.gbl...
> Carl,
>
>
>
> I have checked those as well and they seem to be fine. However .RowFilter is
> set to "" (String.Empty) and .RowStateFilter ist set to "CurrentRows".
>
> I have also read on
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemdatadatatableclassdefaultviewtopic.asp that the DefaultView
> Property is "a customized view of the table which may include a filtered
> view, or a cursor position." I assume it somehow returns a cursor position
> but I'm not sure why.
>
> Thanks
>
> Daniel
>
>
> "Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
> news:uOJ0NTGVDHA.2120@TK2MSFTNGP11.phx.gbl...
> > Daniel,
> > What are the values for the following properties?
> > ds.Tables(0).DefaultView.RowFilter
> > ds.Tables(0).DefaultView.RowStateFilter
> >
> > --
> >
> > Thanks,
> > Carl Prothman
> > Microsoft ASP.NET MVP
> > http://www.able-consulting.com
> >
> >
> > "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote in
> message news:eGL5smFVDHA.2380@TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > I have the following scenario:
> >
> > myDataSet.Tables("tblCustomer").Rows.Count = 4
> >
> > This is quite fine as the table contains 4 rows. However
> >
> > myDataSet.Tables("tblCustomer").DefaultView.Count = 1
> >
> > is not exactly what I expected it to be (I thought the result should be
> 4). Can anybody explain this behavior to me?
> >
> > Thanks in advance
> >
> > Daniel
> >
> >
>
>



Re: DefaultView.Count always returns 1 by Daniel

Daniel
Sun Jul 27 16:37:51 CDT 2003

I'm going completely nuts. I have tried what you did and it works (don't
know if I should be :-) or :-(.). Now I have a form with nothing on it but
two stupid datagrids one bound to the dataset itself and the other one to
the dataview. My application on the other hand still doesn't work & I can't
see any mistake.



If anybody has ANY (really anything!!!) idea what my problem could be please
post it (Could it be a problem that my dataset was stored in a SessionID? Do
I loose any information doing so which I would need now?).



Thank you!



Daniel





"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> schrieb im
Newsbeitrag news:e3RANEIVDHA.2228@TK2MSFTNGP12.phx.gbl...
> Carl,
>
>
>
> this is how I expected it should be but nevertheless I get different
> results. Do you know anything about the "cursor position" part in the
> definition of a DataView as it is written in the MSDN? It seems that I
> always get back a single cursor row but I don't know why and how to prove
my
> assumption?
>
>
>
> Thank you Carl for your help!! I appreciate your efforts.
>
>
>
> Daniel
>
>
> "Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
> news:#2$qvsHVDHA.1676@TK2MSFTNGP10.phx.gbl...
> > Daniel,
> > I get the same count when using the following code:
> >
> > ' Note I create the sqlConnection1 and sqlDataAdapter1
> > ' by dragging a Table from Server Explorer onto the WinForm.
> > Dim ds As DataSet = New DataSet
> > SqlDataAdapter1.Fill(ds, "customers")
> >
> > MsgBox("Rows.Count = " & ds.Tables("customers").Rows.Count)
> > MsgBox("DefaultView.RowFilter = " &
> ds.Tables("customers").DefaultView.RowFilter)
> > MsgBox("DefaultView.RowStateFilter = " &
> ds.Tables("customers").DefaultView.RowStateFilter.ToString())
> > MsgBox("DefaultView.Count = " &
ds.Tables("customers").DefaultView.Count)
> >
> > --
> >
> > Thanks,
> > Carl Prothman
> > Microsoft ASP.NET MVP
> > http://www.able-consulting.com
> >
> >
> > "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote in
> message news:ehhn#8GVDHA.2316@TK2MSFTNGP09.phx.gbl...
> > > Carl,
> > >
> > >
> > >
> > > I have checked those as well and they seem to be fine. However
> .RowFilter is
> > > set to "" (String.Empty) and .RowStateFilter ist set to "CurrentRows".
> > >
> > > I have also read on
> > >
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> > > frlrfsystemdatadatatableclassdefaultviewtopic.asp that the DefaultView
> > > Property is "a customized view of the table which may include a
filtered
> > > view, or a cursor position." I assume it somehow returns a cursor
> position
> > > but I'm not sure why.
> > >
> > > Thanks
> > >
> > > Daniel
> > >
> > >
> > > "Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
> > > news:uOJ0NTGVDHA.2120@TK2MSFTNGP11.phx.gbl...
> > > > Daniel,
> > > > What are the values for the following properties?
> > > > ds.Tables(0).DefaultView.RowFilter
> > > > ds.Tables(0).DefaultView.RowStateFilter
> > > >
> > > > --
> > > >
> > > > Thanks,
> > > > Carl Prothman
> > > > Microsoft ASP.NET MVP
> > > > http://www.able-consulting.com
> > > >
> > > >
> > > > "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote
in
> > > message news:eGL5smFVDHA.2380@TK2MSFTNGP09.phx.gbl...
> > > > Hi,
> > > >
> > > > I have the following scenario:
> > > >
> > > > myDataSet.Tables("tblCustomer").Rows.Count = 4
> > > >
> > > > This is quite fine as the table contains 4 rows. However
> > > >
> > > > myDataSet.Tables("tblCustomer").DefaultView.Count = 1
> > > >
> > > > is not exactly what I expected it to be (I thought the result should
> be
> > > 4). Can anybody explain this behavior to me?
> > > >
> > > > Thanks in advance
> > > >
> > > > Daniel
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: DefaultView.Count always returns 1 by Daniel

Daniel
Mon Jul 28 15:20:51 CDT 2003

Hi Carl,



I think I got it somehow to work. AFAIK by now I got my datasets somehow
messed up as I move them around between different asp.net pages.



Thank you!



Daniel.



P.S. It's difficult for me to post you some code as the .DefaultView method
works (as I told you) when used with a simple page. I would have to post you
the project and the related tables for you to reproduce my problem. Thanks
though for your offer!!




"Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
news:#pYhGbIVDHA.612@TK2MSFTNGP10.phx.gbl...
> Daniel,
> Please post some code that repros the problem.
>
> --
>
> Thanks,
> Carl Prothman
> Microsoft ASP.NET MVP
> http://www.able-consulting.com
>
>
> "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote in
message news:e3RANEIVDHA.2228@TK2MSFTNGP12.phx.gbl...
> > Carl,
> >
> >
> >
> > this is how I expected it should be but nevertheless I get different
> > results. Do you know anything about the "cursor position" part in the
> > definition of a DataView as it is written in the MSDN? It seems that I
> > always get back a single cursor row but I don't know why and how to
prove my
> > assumption?
> >
> >
> >
> > Thank you Carl for your help!! I appreciate your efforts.
> >
> >
> >
> > Daniel
> >
> >
> > "Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
> > news:#2$qvsHVDHA.1676@TK2MSFTNGP10.phx.gbl...
> > > Daniel,
> > > I get the same count when using the following code:
> > >
> > > ' Note I create the sqlConnection1 and sqlDataAdapter1
> > > ' by dragging a Table from Server Explorer onto the WinForm.
> > > Dim ds As DataSet = New DataSet
> > > SqlDataAdapter1.Fill(ds, "customers")
> > >
> > > MsgBox("Rows.Count = " & ds.Tables("customers").Rows.Count)
> > > MsgBox("DefaultView.RowFilter = " &
> > ds.Tables("customers").DefaultView.RowFilter)
> > > MsgBox("DefaultView.RowStateFilter = " &
> > ds.Tables("customers").DefaultView.RowStateFilter.ToString())
> > > MsgBox("DefaultView.Count = " &
ds.Tables("customers").DefaultView.Count)
> > >
> > > --
> > >
> > > Thanks,
> > > Carl Prothman
> > > Microsoft ASP.NET MVP
> > > http://www.able-consulting.com
> > >
> > >
> > > "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de> wrote in
> > message news:ehhn#8GVDHA.2316@TK2MSFTNGP09.phx.gbl...
> > > > Carl,
> > > >
> > > >
> > > >
> > > > I have checked those as well and they seem to be fine. However
> > .RowFilter is
> > > > set to "" (String.Empty) and .RowStateFilter ist set to
"CurrentRows".
> > > >
> > > > I have also read on
> > > >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> > > > frlrfsystemdatadatatableclassdefaultviewtopic.asp that the
DefaultView
> > > > Property is "a customized view of the table which may include a
filtered
> > > > view, or a cursor position." I assume it somehow returns a cursor
> > position
> > > > but I'm not sure why.
> > > >
> > > > Thanks
> > > >
> > > > Daniel
> > > >
> > > >
> > > > "Carl Prothman [MVP]" <carlpr@spamcop.net> schrieb im Newsbeitrag
> > > > news:uOJ0NTGVDHA.2120@TK2MSFTNGP11.phx.gbl...
> > > > > Daniel,
> > > > > What are the values for the following properties?
> > > > > ds.Tables(0).DefaultView.RowFilter
> > > > > ds.Tables(0).DefaultView.RowStateFilter
> > > > >
> > > > > --
> > > > >
> > > > > Thanks,
> > > > > Carl Prothman
> > > > > Microsoft ASP.NET MVP
> > > > > http://www.able-consulting.com
> > > > >
> > > > >
> > > > > "Daniel Walzenbach" <daniel.walzenbach.NOSPAM@freudenberg.de>
wrote in
> > > > message news:eGL5smFVDHA.2380@TK2MSFTNGP09.phx.gbl...
> > > > > Hi,
> > > > >
> > > > > I have the following scenario:
> > > > >
> > > > > myDataSet.Tables("tblCustomer").Rows.Count = 4
> > > > >
> > > > > This is quite fine as the table contains 4 rows. However
> > > > >
> > > > > myDataSet.Tables("tblCustomer").DefaultView.Count = 1
> > > > >
> > > > > is not exactly what I expected it to be (I thought the result
should
> > be
> > > > 4). Can anybody explain this behavior to me?
> > > > >
> > > > > Thanks in advance
> > > > >
> > > > > Daniel
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>