Solved

URGENT - UNION query only returns second dataset to gridview

Posted on 2008-06-18
2
275 Views
Last Modified: 2010-05-18
This is urgent.

I have a UNION query and my gridview is only returning the second query from the SQL statement.  I know the queries both return data because when I reverse the SQL Statements the other result set is shown.

The query is run via stored procedure so I'm not even sure how .NET knows, but it does.
0
Comment
Question by:dtburdick
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 21817198
can you show the relevant code, please.
0
 

Author Comment

by:dtburdick
ID: 21817306
My mistake, it's really screwy because I'm generating the SQL on the fly.  It wasn't a bug with my .NET code, it was a bug in my T-SQL where I was resetting the SQL string for each query.

I thought it was a problem with the dataset having two tables or something.

Cut and Paste can kill sometimes.

Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question