|
|
I don't know much about database but this is somthing similar in terms of keys relationship. Let me know if I am right. Assume that I have a table name customer than inside that table I have the following fields.
CustomerID
FirstName
LastName
PhoneNUmber
Address
City
Zipcode
Insde that table I can have a customer name Jhon, Gerry, Fred, Tony
Now, I have another table name Order, insider that table I have
OrderNumber
Price
Quantity
Total
I don't know a lot about database, but I assume there is a relationship between CustomerID and OrderNumber.
Now assume that Gerry order 1 Item, based on the following
OrderNumber = 320;
Price = $2
Quantity = 1
Total = $2
How many relationship to I have? I assume one, I also think that Gerry oder number can be retrieved from his name, order number or customer number, etc. Basically, I want to do something similar to that, for example, for one person I can have multiple order. What is different from mine, is that all the fields from the second table do not need to be filled. Some of them can be empty.
|
|
|
|
|
mfcuser wrote: How many relationship to I have?
Zero - You have not set up a relationship between Customer and Order.
The Order table needs to know to which customer each order refers. You must add a CustomerId to the Order table.
mfcuser wrote: What is different from mine, is that all the fields from the second table do not need to be filled. Some of them can be empty.
That is fine - it isn't a big deal, just make the columns nullable.
|
|
|
|
|
I get you. The relationship is not setup yet, but it can be setup. I don't have access in my machine to try some examples. In the diagram view of visual studio, assume that I have the two table. If I drag customerid to order number, does that establish a relationship automatically?
|
|
|
|
|
mfcuser wrote: If I drag customerid to order number, does that establish a relationship automatically?
It would pop up a dialog to confirm which columns from each table are used to form the relationship. However, a relationship with customerId on one end with Order number on the other would not work because they are not the same thing.
You must have the same keys on both ends of the relationship. One is the primary key on the parent table, and the other is a foreign key on the child table. You must have CustomerId (or something that represents customerId on both tables).
So the CustomerID of the Customer table is used to form a relationship with CustomerID on the Order table. There will be many rows in the Order table with the same CustomerID.
|
|
|
|
|
I am looking at the Northwind database. When I open the category table, it brings a table which looks like table inside table. That may not be the way to say it. I believe that may be based on relationship. When I clicked on the plus sign, it opened a child table, then when the child table open, I clicked on the plus sign again, then it opened another child table. I assume that is because of the relationship.
|
|
|
|
|
mfcuser wrote: I assume that is because of the relationship.
Yes, you assumed correctly
You will see a delete button on each of your posts. Press it. - Colin Angus Mackay
|
|
|
|
|
mfcuser wrote: When I open the category table, it brings a table which looks like table inside table
That is a manifestation of the user interface. There is no table within a table.
mfcuser wrote: I believe that may be based on relationship.
That is correct.
mfcuser wrote: When I clicked on the plus sign, it opened a child table, then when the child table open, I clicked on the plus sign again, then it opened another child table. I assume that is because of the relationship.
Yes. There are a number of relationships in the Northwind database.
|
|
|
|
|
From time to time, I've noticed a question being posted here that is related to a new project that was uploaded.
For example:
A new (fictitious) project named "My lookup control with added filtering" is posted.
Then a post (from a username other than the developer) asks for a control the performs lookups and has some added filter capabilities.
It's not exactly a "Fox Mulder" conspiracy, but it seems like this scenario happens too many times to be a coincidence.
Anyone else notice this?
|
|
|
|
|
Not sufficiently often that I've thought of it more than just a mere coincidence.
On the other hand, I have written an article because I saw the same question asked repeatedly. It is possible that someone did this and people still ask in the forums because, well... It's just so much easier to do that than figure out how Google works.
|
|
|
|
|
Sneaky bastards!
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi,
I want to store the location of a file in C# program, but
the file may be moved into another location. So besides using
the File System Watcher, can I store other information of the file
instead of the location, so that the shell or window can recognize
the file by the stored info and give me the new location information ?
Thanks
|
|
|
|
|
I'm not sure exactly what you are asking. Do you mean you want dynamic info for your program that's not hard coded? If so, use app.config.
If that's not what you mean, please clarify it for me.
|
|
|
|
|
AFAIK no, since files (on FAT and NTFS) are identified by their fully qualified name. Methinks you're better off storing information such as this in the registry.
/ravi
|
|
|
|
|
Hi, I have a control that has a size of 800 by 600 and i want to print the exact same size on my bImage. But on my print preview it's somehow my bImage is getting trimed. But if i increase the size from 800 by 600 to 900 by 700 then i get the full image.
Can somebody help me so i get the full image within the size of 800 by 600
Thanks
Bitmap bImage = new Bitmap(800, 600);
objectesList[i]).DrawToBitmap(bImage, new Rectangle(20, 80, 800, 600));
e.Graphics.DrawImage(bImage, new Rectangle(20, 40, 800, 600));
|
|
|
|
|
Hi,
I do not know what DrawToBitmap exactly does but in that function you are using a Rectangle to specifiy the bounds where the something should be painted. The Rectangle has an offset (not starting at 0;0 but at 20;80). What is this offset for? Have you tried leaving it away?
Bitmap bImage = new Bitmap(800, 600);
objectesList[i]).DrawToBitmap(bImage, new Rectangle(00, 800, 600));
e.Graphics.DrawImage(bImage, new Rectangle(0, 0, 800, 600));
Robert
|
|
|
|
|
Thanks, it does display the entire image now. But, i am getting the image width 800 that's what i want but another thing is that my image height its more than 600. If i reduce the image height then my image get trimmed from the bottom.
I couldn't figure it out why is this happening.
Thanks
|
|
|
|
|
Hi...
Can any1 direct me to a TabPage control that has a closing functionality.
thanks
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
t4urean wrote: closing functionality
What do you mean by this?
only two letters away from being an asset
|
|
|
|
|
The Original TabPage control don't have any closing button or somefin like that. I want to be able to close the tabpage by using Mouse clicks etc
Hope U understand my Question
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
|
Yes Of course!!1
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
Hello!
You can try this. It's a great control with the look and feel of VS2005.
Regards
|
|
|
|
|
|
Hi everyone!
I am using Windows XP. I want my program to save a file into windows temporary folder under the local settings of the current user.
1. How I can do that?
2. How I can create hexa-decimal array generated name of these files and discard them after use.
Thank you.
|
|
|
|
|