|
I think I'm going to throw that code in the trash and start again with a model to populate instead; split up the function into a load, calculate and then write.
Globalism is Socialism on a planetary scale.
|
|
|
|
|
I'd be inclined to normalize that table a lot more. You'd probably want something more like:
- Products - SKU, type, taxable, prices, weights, brand, department, vendor, etc.
- Customers - ID, account name, etc.
- Carts - ID, customer ID, etc.
- Items - ID, cart ID, product ID, quantity, price
Depending on your design, it might make sense to duplicate the product data on the lines for a processed cart. But "in-progress" carts should be referring back to the master product list.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I went too far on duplicating fields in the shopping cart.
Now that I have the Automatic Migration working, I think I'll trim that down.
Globalism is Socialism on a planetary scale.
|
|
|
|
|
I shorted it down to this, and will just do a join to the master product table.
Would you include the price or leave that out as well?
public class SHOPPING_CART
{
[Key()]
[Column(Order = 1)]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int cart_ID { get; set; }
[Required]
public int customer_ID { get; set; }
[Required]
[MaxLength(80)]
public string customer_accountName { get; set; }
[Required]
public DateTime timeStamp { get; set; }
[Required]
[MaxLength(80)]
public string item_Type { get; set; }
[Required]
public int item_ID { get; set; }
[Required]
public int item_Qty { get; set; }
}
Globalism is Socialism on a planetary scale.
|
|
|
|
|
Since you don't seem to have quantity breaks or any other complicated calculations, and you're removing the cart once it's processed, I'd be inclined to leave the price on the product.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Just out of the topic, but I am asking this here because I want to directly ask you, your caption says "Globalism is Socialism on a planetary scale", how, do you mean Socialism is nothing but imposing unwanted rules on mass people?, is it in that way?
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
I changed it to "21st century globalism is socialism on a planetary scale", makes more sense now.
I seriously doubt anyone cares why I think this now, and I would private message you why, but I think they removed the private message feature; can't find yours. And I don't want to violate the rules of the forum by posting my thoughts on this. But I do have a well detailed anwser for it.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
It doesn't matter for me my friend, its just your opinion as I will have mine, I respect your opinion but just asked what was your logic in it. We have both things in our genes that's to protect our territory and to cross territory, it came from animal genes that they were our fathers millions of millions of years back as per Darwin sir
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 6-Dec-16 20:17pm.
|
|
|
|
|
Sign Up | LinkedIn[^]
My contact info is here, just drop me an email and then I will delete this post
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.
|
|
|
|
|
I am writing a application that are going to run on small NAS servers using Java.
For that purpose I am looking for a nosql database that can be embedded in my application.
Another requirement I have is that is should be possible to connect to the database from remote clients.
Thats is, piece of cake. Beside those two requirements I am prepared to adapt my application to the database.
I know for example of MongoDB, Neo4J and OrientDB but have no experience of running them on small CPUs.
Any tips, tricks or recommendations.
//lg
/happy amateur
|
|
|
|
|
Create your own engine for minimal XML-based data sources. Your programs will read, write the data to these XML data sources and you can relax while it works on low-power CPUs too.
I personally use JSON for my regular day tasks instead of XML, but you can select either, then write an engine for that; CRUD functions and a bit of validation etc.
Create, read, update and delete - Wikipedia[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
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
select *
from vwTestMAF
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
RAH
|
|
|
|
|
Perhaps qualifying the field names could help.
...where vwTestMAF.TestMAFID = -1 or vwTestMAF.TestMAFID = TestMAFID;
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Qualifying the names did the trick, I was hoping there was a standard convention the mysql users would recognise.
|
|
|
|
|
The old MySQL method was to placehold with ? so and you had to add the values in the right order, currently MySQL uses @ and it works, not sure about MariaDB;
select *
from vwTestMAF
where TestMAFID = -1 or TestMAFID = ?;
|
|
|
|
|
What are some tricky/interesting SQL questions you were asked in interviews?
|
|
|
|
|
|
Have a google for Sql Central, that site offers a "question of the day" which allows you to keep brushed up on your SQL Server and TSQL skills.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
qptopm wrote: What are some tricky/interesting SQL questions you were asked in interviews? Any detail from a book that is hardly used and therefore hard to remember. Most of these questions test your memory, not your understanding of how a database works.
Syntax is something you can look up quickly, but understanding never comes quick.
So, in your own words, what is a database, and when would I use one?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi,
I'm getting the following errors while creating Filestream features in Sql server???
How to solve this error,Please help me???
ERROR:-
Msg 1969, Level 16, State 1, Line 1
Default FILESTREAM filegroup is not available in database 'HumanResource'.
Thanks...
|
|
|
|
|
That is because you have to create that group, it is not provided in your database by default. You must enable it,
FILESTREAM is not automatically enabled when you install or upgrade SQL Server. You must enable FILESTREAM by using SQL Server Configuration Manager and SQL Server Management Studio So do that, then you will be able to overcome this error. A documentation is given here too, FILESTREAM (SQL Server)[^].
Default FileStream filegroup is not available in database 'DatabaseName'[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
I am trying to execute the following update query:
update committees c1 set num_subcommittees =
case
when parent_committee is not null then -1
else (select count(*) from committees c2 where c2.parent_committee = c1.id)
end;
But instead getting mySql 1093 error. The table structure is like this:
CREATE TABLE `committees` (
`id` char(5) NOT NULL,
`parent_committee` char(5) DEFAULT NULL,
`name` char(200) DEFAULT NULL,
`chairman` char(40) DEFAULT NULL,
`ranking_member` char(40) DEFAULT NULL,
`num_subcommittees` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Please comment.
|
|
|
|
|
What is c1? Just use committees to update the table.
PHP Update Data in MySQL[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
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.
|
|
|
|