|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to check if the dataset is EOF or if a record exists frist .how to check if the dataset is EOF or if a record exists frist in ADO.NET and
vb2005: Dim conn As New SqlConnection("User ID=sa; password=apw!pain; Initial Catalog=APW_SYSTEM;Data Source=paradigm") Dim sqlstr As String = "SELECT * FROM sysMaster WHERE sysName = 'IT_1'" Dim da As SqlDataAdapter = New SqlDataAdapter(sqlstr, conn) Dim ds As New DataSet MessageBox.Show(ds.Tables(0).Rows(0).Item("sysName").ToString) ds.dispose() On Thu, 28 Dec 2006 07:01:00 -0800, Andrew wrote:
> ds.Tables(0).Rows You can check the rowcountIf ds.Tables(0).Rows.Count > 1 then ' ' do your stuff here ' End If thanks, I was counting the records witch is alttle bit longer to do..
Show quoteHide quote "Rad [Visual C# MVP]" wrote: > On Thu, 28 Dec 2006 07:01:00 -0800, Andrew wrote: > > > ds.Tables(0).Rows > > You can check the rowcount > > If ds.Tables(0).Rows.Count > 1 then > > ' > ' do your stuff here > ' > > End If > -- > Bits.Bytes > http://bytes.thinkersroom.com > Don't you mean
If ds.Tables(0).Rows.Count >= 1 Then ? Robin S. ------------------------ Show quoteHide quote "Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message news:v8fr5x3xlgpw.dlg@thinkersroom.com... > On Thu, 28 Dec 2006 07:01:00 -0800, Andrew wrote: > >> ds.Tables(0).Rows > > You can check the rowcount > > If ds.Tables(0).Rows.Count > 1 then > > ' > ' do your stuff here > ' > > End If > -- > Bits.Bytes > http://bytes.thinkersroom.com On Thu, 28 Dec 2006 10:15:19 -0800, RobinS wrote:
> Don't you mean Oops. My bad. Of course >= 1. Mind was poisoned by the fact that i was> > If ds.Tables(0).Rows.Count >= 1 Then > > ? > > Robin S. working on something with similar logic that needed two records.
Show quote
Hide quote
"Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message A-HA!! Your mind has a dual core processor. Cool.news:o5ts5ze17hbz.dlg@thinkersroom.com... > On Thu, 28 Dec 2006 10:15:19 -0800, RobinS wrote: > >> Don't you mean >> >> If ds.Tables(0).Rows.Count >= 1 Then >> >> ? >> >> Robin S. > > Oops. My bad. Of course >= 1. Mind was poisoned by the fact that i was > working on something with similar logic that needed two records. > > -- > Bits.Bytes > http://bytes.thinkersroom.com Robin S. On Thu, 28 Dec 2006 12:54:31 -0800, RobinS wrote:
Show quoteHide quote > > A-HA!! Your mind has a dual core processor. Cool. > > Robin S. :( I wish! More like a 286
Show quote
Hide quote
"Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message LOL. Personally, I'd like to install more memory!news:1czir8jyozf9p$.dlg@thinkersroom.com... > On Thu, 28 Dec 2006 12:54:31 -0800, RobinS wrote: > > >> >> A-HA!! Your mind has a dual core processor. Cool. >> >> Robin S. > > :( I wish! More like a 286 > > -- > Bits.Bytes > http://bytes.thinkersroom.com Robin S. "Rad [Visual C# MVP]" <nospam@nospam.com> wrote in message At least it isn't a Tandy TRS-80. :) Where would you load the tape????? news:1czir8jyozf9p$.dlg@thinkersroom.com... > :( I wish! More like a 286 Uh... Don't want to know!!! :)
When to use AndAlso vs And ?
Trying to get started with tables... Binary Search Tree - CompareTo Error Waiting for a process to halt before continuing Beginner help with FolderBrowserDialog How do I handle a NULL XmlElement? Get spawned process GotFocus versus PreviewKeyDown or Other VB.Net application deployment Finding interrelation between primary keys in tables |
|||||||||||||||||||||||