For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have this flattened database design, and in checkout, I need to get the total weight of the cart items.
So I did a method call to the shopping cart and I have the items in a List,
But I need to get the Product Dimensions in another table that I did not join, because I used the database table to store the data in and I don't have a place to store the dimensions.
I'm not sure if I should rewrite this again, or if there is a quick fast way to get the dimensions.
I really don't want to make another model to do this.
// Build a list of cart items
if (context.SHOPPING_CART.Any(m => m.customer_accountName == aN))
sCs = context.SHOPPING_CART.Where(m => m.customer_ID == cID).ToList();
if (sCs != null)
orderTotal = sCs.Sum(m => m.item_Price_Value * m.item_Qty);
orderCost = sCs.Sum(m => m.item_Cost_Value * m.item_Qty);
orderProfit = orderTotal - orderCost;
orderWeight = "was hoping for quick method here"
Weight_Gravity is the field that I want to join so I can sum.
On the design of the cart, I decided to use a field called "Account Name". At first when an account does not exist, I use the session number in the "Account Name" field. Then I try to lure the shopper into creating an account or upon checkout, they create an account. Once the account is created, I write a cookie with their info and swap the session number with the account name. Now the stage is set for each time the cart page is loaded, I can load their items automatically, from any device they use such as phone or desktop.
Upon PlaceOrder, the Linq I'm asking about, the cart content will be copied to another table and the shopping cart will be deleted.
This is the program at it's current state, [Project Indigo] - test drive store.
There's a table called "Product_Info" that contains the master product information, In which "Product_Dimensions" can be joined to.
I've been faffing around with MariaDB with the view to converting our SQL Server Apps. First step is to convert out CRUD code generator. I'm used to SQL Server which insists that I prefix a parameter value with @ MySQL has no such rule and you can end up with something like
where TestMAFID = -1 or TestMAFID = TestMAFID;
where the TestMAFID is both the field name and the parameter name and the query naturally does not work.
Is there a naming convention for MySQL parameter (prefixing the parameter name with @ did not work either!)
Never underestimate the power of human stupidity
Your signature (Jassim) points to a site seems to be commercial... It is not really accepted here and can cause you to be banned for spamming...
Please remove it (or restore it to its previous value - your personal site)!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
The instructor table looks a bit odd to me, having both ID and InstructorID I would assume you meant InstructorID and InstructorName.
And as an addition to what Mycroft said, in a fully normalized database you always use the same name for an entity throughout the database. It's not just a good idea, it's a standard[^].
And just like Mycroft said, for a surrogate key, using <tablename> + "ID" is a good idea
if OP put it in the Lounge they'd get flamed by many.
I don't see why, as it is not a programming question, more a general request for opinions and experiences. Plenty of similar discussions appear in the Lounge. I know these forums are titled "Discussions", but in reality they are for asking Technical Questions.
Ignore Richard and the bastard, this is an appropriate question in the correct forum.
Unfortunately your question is a little too broad to elicit a reasonable response. SSIS is such a wide subject.
I do know that we moved from ETL to ELT where the transforms are done via stored procedure. It is faster and I find it easier to debug and test. So SSIS just moves the data from the source into staging tables and launches the transform stored proc.
Never underestimate the power of human stupidity
In 3rd table, you can see that I am using boolean column which tells whether this Order belongs to guest user or member user. I want to select corresponding data using ONE QUERY. Here is what I have tried so far but it is far from working
SELECT O.*, CASE WHEN O.IsUserMember = 1 THEN U.UserName ELSE M.MemberName END
FROM Orders O, CASE WHEN O.IsUserMember = 1 THEN Users U ELSE Members M END
WHERE CASE WHEN O.IsUserMember = 1 THEN O.UserId = U.UserId ELSE B.UserId = M.MemberId END;
It is giving me this following error: Syntax error near 'CASE WHEN B.IsThisUserMember = 1 THEN Users U ELSE Members M END WHERE CASE WHEN' at line 1
NOTE: If I remove first CASE condition, then I get empty set. Thanks for whatever you share.
Last Visit: 31-Dec-99 19:00 Last Update: 4-Dec-16 12:28