473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

check record and then run second query to display in data grid

Hi All,

I am doing it for the first time in C# (using Visual Studio 2005),

First I need to check if data exists in a table for a variable. If so
then run the second query and display the resultsets in Gridview.

For ex., in the form I am entering contract id and running the query
for that contract id. If results found then use that contract id to
run the second query and show the results in gridview.

My question is how I can accomplish that?
I do appreciate your help.

Thanks a ton in advance.
best regards,
Mamun

Jan 30 '07 #1
1 1834
You can find a lot of examples here:

http://msdn2.microsoft.com/en-us/data/aa937711.aspx
http://samples.gotdotnet.com/quickst...sOverview.aspx
http://quickstarts.asp.net/QuickStar.../gridview.aspx

Also, I think you don't need two queries. Just run the select query and
check if the result contains records or not.
If you are using ASP.NET, you might be able to do it without writing code
(or almost).
"mamun" <ma******@hotmail.comha scritto nel messaggio
news:11**********************@j27g2000cwj.googlegr oups.com...
Hi All,

I am doing it for the first time in C# (using Visual Studio 2005),

First I need to check if data exists in a table for a variable. If so
then run the second query and display the resultsets in Gridview.

For ex., in the form I am entering contract id and running the query
for that contract id. If results found then use that contract id to
run the second query and show the results in gridview.

My question is how I can accomplish that?
I do appreciate your help.

Thanks a ton in advance.
best regards,
Mamun

Jan 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
2
by: Corky | last post by:
I have a very simple database. It tracks service calls. It has fields for two technicians; Tech1 and Tech2. It captures their hours against a labor category (electrical, plumbing, carpentry, etc.)...
10
by: Mark | last post by:
I have a table about people containing 25 fields. The table contains the usual fields - first, last, address, city, state and zip. There is no primary key. These fields all have data with the...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
3
by: D. Shane Fowlkes | last post by:
(still a .NET newbie) I have a chunk of code in a Page_Load routine that pulls data from a SQL Server table. The Select statement looks for any "events" scheduled for today. Then my IF...
1
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
0
by: fig000 | last post by:
Hi, I'm trying to use the sqldatasource control and a detailsview to create a fully functional data entry screen; it's quite easy. I can see the strength of creating a master grid associated...
9
by: =?Utf-8?B?UHJhdmlu?= | last post by:
We are using .net Framework 1.1 We are having one page on which we are using this Grid component. From this page we open a popup for adding new record as well as for editing an existing record...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.