Wrox Programmer Forums
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2003, 07:46 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginner

Hi I complityly new in .NET and have a lot of problems
I would like to do basic task:
1) Open connection
2) fill data set
3) find out if dataset is bof or eof but in ado net there is no bof and eof property haw can i do this task
Here is my code

Dim CN As New SqlConnection
Dim DA As New SqlDataAdapter
Dim DS As New DataSet
Dim cmd As New SqlClient.SqlCommand


Dim strSQL As String
dim cnString as String

cnString = "someString"
strSQL = "SELECT SUBJEKT,GESLO from CONTACTS " _
 & " WHERE USERID = '" & UserName & "'"

CN.ConnectionString = cnString
cmd.CommandText = strSQL
cmd.CommandType = CommandType.Text
cmd.Connection = CN

CN.Open()


DA.SelectCommand = cmd
DA.SelectCommand.ExecuteNonQuery()

        Try

            DA.Fill(DS)


        Catch ex As Exception

        End Try

Here i want to ask for dataset if it is bof or eof

Thanks
Aleksandar
 
Old October 27th, 2003, 08:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Aleksandar,

A DataSet does not have an EOF or BOF property, like an ADO Recordset does. You can, however, find out whether one of the tables in the DataSet contains 1 or more rows:
Code:
If DS.Tables(0).Rows.Count > 0 Then
This code checks whether the first table in the DataSet contains at least a row.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ beginner, need help please jmarsh56 Visual C++ 0 December 7th, 2005 10:38 AM
Beginner Tilak_1 C# 2 January 21st, 2005 11:19 PM
Beginner [email protected] Beginning PHP 4 December 23rd, 2004 03:22 PM
Need help - C++ beginner Satheesh C++ Programming 13 August 7th, 2004 09:18 PM
Beginner programmed XML 3 February 21st, 2004 05:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.