Print Page | Close Window

Dataadapter with no results and datasets

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=2555
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Dataadapter with no results and datasets
Posted By: pnp!
Subject: Dataadapter with no results and datasets
Date Posted: 09 May 2003 at 11:32am

I'm trying to fill a datasete with a dataadapter.

When the query I made in the dataadapter have no results

Here's the code

Dim cnChequesRech As SqlConnection
Dim daChequesRech As SqlDataAdapter
cnChequesRech = New System.Data.SqlClient.SqlConnection("Password=;User ID=sa;Initial Catalog = ChequesRechazados;Data Source=srv3")
cnChequesRech.Open()
daChequesRech = New SqlDataAdapter("SELECT * from CETBAVRC where RAIZ = '" & Raiz & "'", cnChequesRech)
daChequesRech.Fill(dsRechazados, "ListadoRechazados") --> I get the error here!, as the query come with no results
cnChequesRech.Close()

How can I detect when the dataadapter has no results in order not to fill the datasete?

Thanks!....




Replies:
Posted By: Bunce
Date Posted: 10 May 2003 at 1:42am

If using Visual Studio.Net you can preview the data returned from a Data Adapter.  From memory, its just a right-click option.

Also try removing the , "ListadoRechazados" argument from your fill statement.

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net