473,698 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sql queries 2 datagrids

I have a table that contains customers, and another table that has customers
and items they are authorized for.

I would like to show a datagrid (1) with customers that are authorized for a
select item the user choose, and datagrid (2) that shows which customers are
not in that table for that item. The datagrid2 is the one that I am confused
with. The table can contain many items for many stores. So I had the
query:

SELECT store, itemnum
FROM tblCustomers LEFT OUTER JOIN
tblAuthorized ON tblCustomers.Nu m = tblAuthorized.s tore
WHERE (tblAuthorized. store IS NULL) AND (tblAuthorized. itemnum = '120027')

This returns no stores?

If I select the itemnumber in a view that connects to this query, so there
is no tblAuthorized.i temnum = '120027', just querying a view of stores that
have that specific itemnumber.

Any way to send a store number to a view and then connect that view (stores
with certain item) to do an outer join with tblCustomers to get those that
are missing with that item?

Thanks for any help.
Jul 21 '05 #1
1 1188
Don't use a Join for this unless you are 100% positive you don't want to use
a DataAdapter for your updates - and even then I'd avoid it. Use a
DataRelation and two separate queries, two separate adapters - life will be
SOOO much better for you .
http://www.knowdotnet.com/articles/datarelation.html
"AshleyT" <As*****@discus sions.microsoft .com> wrote in message
news:E3******** *************** ***********@mic rosoft.com...
I have a table that contains customers, and another table that has customers and items they are authorized for.

I would like to show a datagrid (1) with customers that are authorized for a select item the user choose, and datagrid (2) that shows which customers are not in that table for that item. The datagrid2 is the one that I am confused with. The table can contain many items for many stores. So I had the
query:

SELECT store, itemnum
FROM tblCustomers LEFT OUTER JOIN
tblAuthorized ON tblCustomers.Nu m = tblAuthorized.s tore
WHERE (tblAuthorized. store IS NULL) AND (tblAuthorized. itemnum = '120027')
This returns no stores?

If I select the itemnumber in a view that connects to this query, so there
is no tblAuthorized.i temnum = '120027', just querying a view of stores that have that specific itemnumber.

Any way to send a store number to a view and then connect that view (stores with certain item) to do an outer join with tblCustomers to get those that
are missing with that item?

Thanks for any help.

Jul 21 '05 #2

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

Similar topics

0
1103
by: morgal | last post by:
Well, I'll look into my crystal ball and tell you what I've experienced according to your lack of description of your problem and error codes: 1st make 1 recordset per databinding. I'll assume you are using MS-SQL (I recognise the practice db). I believe you will need to do this to keep track of the data pointers for current record. I've not seen a good implementation of batch queries with
4
416
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem is that on a postback I lose all the datagrids and their data. I have looked at numerous pages on the net regarding this issue. Many say you have to rebuild build the controls on postback. How am I meant to do this in my situation as I don't...
0
1253
by: Scott Meddows | last post by:
I'm having trouble scrolling some datagrids so they sync up... I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the other dataset then scrolls to the same place on the other dataset (bare with me). This is the code that I have so far... Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load...
1
253
by: AshleyT | last post by:
I have a table that contains customers, and another table that has customers and items they are authorized for. I would like to show a datagrid (1) with customers that are authorized for a select item the user choose, and datagrid (2) that shows which customers are not in that table for that item. The datagrid2 is the one that I am confused with. The table can contain many items for many stores. So I had the query: SELECT ...
3
1972
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of about 20px. the amount of rows in those grids is changing, but the position of each datagrid seems to be fixed. this results in a grid overlaying another one or the space between two grids is way too high.
7
1845
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table in a different dataset. One combo box is displaying the Employees payroll ID. The other is
2
1933
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a particular order (like ProductID, Name, Description, Quantity etc.) are displayed in one DataGrid where as the personal details of the buyer corresponding to this order (like Name, E-Mail, Shipping & Billing Address etc.) are displayed in another...
0
1080
by: Jim | last post by:
OK here's my disclaimer: I'm very new to ASP.NET and posting on Google Groups, so please bear with me and feel free to correct either the way I code or the way I post. I have an ASP.NET page that is driven off of a dynamic dropdownlist control. In the page_load sub, I make the DB connection and fill the list based on a table of employees. Once an employee is selected, there are various datagrids below that are populated based on that...
1
1314
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I am using the code below to export a webpage to Excel. The webpage has three datagrids on it and they are all exported to Excel properly and everything looks very nice, but we would really only like two of the three datagrids to be exported. Is there a way to exclude certain sections of the webpage from being exported to Excel? "DG" in the code here is one of the datagrids on the page: ...
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3045
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 we have to send another system
2
2327
muto222
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.