 |
|
 |
hi dear
shopping cart is very good.
how to add quantity & edit or delete shopping cart and get total price.
best regars
kamran nemati
|
|
|
|
 |
|
 |
private void AddShopCart(string ItemId)
{
string ord = OrderNumber();
if (ord != "Bad order")
{
int ordernumber = Convert.ToInt32(ord);
ordernumber += 1;
SqlConnection C_n = new SqlConnection(Cn);
SqlCommand cm = new SqlCommand("Insert INTO OrderTable VALUES
('" + ordernumber + "', '" + ItemId + "', '" + "101" +
"', '" + Convert.ToDateTime("2/19/2007") + "','" + "1" + "')", C_n);
C_n.Open();
SqlDataReader dr = cm.ExecuteReader();
C_n.Close();
UpdateOrderNumber(ordernumber);
}
}
|
|
|
|
 |
|
 |
change ordernumber column datatype to int
Tanveer
WWW.TANVTECH.COM
SOFTWARE ENGINEER
|
|
|
|
 |
|
 |
hi dear
when I run shoppingcart.aspx not show anything.
please help me.
Best Regards
Kamran Nemati
modified 4 Jan '12.
|
|
|
|
 |
|
 |
Please make sure your code are same as mine, and you have created the atble also.
Tanveer
WWW.TANVTECH.COM
SOFTWARE ENGINEER
|
|
|
|
 |
|
|
 |
|
 |
Kindly send me the database associated with this article at shweta1786@gmail.com
Its urgent!!
|
|
|
|
 |
|
 |
| It is 2 tables you can just create them as shown in the diagram, it has been some time when i did this project. Tanveer
WWW.TANVTECH.COM
SOFTWARE ENGINEER
|
|
|
|
 |
|
 |
The article is gud enough. But I need the database of this project ASAP. Can someone send me the database for this shopping cart application. My email id is sharadmishr@gmail.com
Thanx in advance.
|
|
|
|
 |
|
 |
The article is gud enough. But I need the database of this project ASAP. Can someone send me the database for this shopping cart application. My email id is sharadmishr@gmail.com
Thanx in advance.
|
|
|
|
 |
|
 |
Hello,
I am a beginner to C# and was trying out this shopping cart to practise.
When I run the pages, no errors appear, however I cannot see any data in my Gridview
As a result I cannot see anything being added and subsequently nothing can be deleted!
Is the data not being picked up from the SQL server? What do you think the problem could be?
I look forward to hearing from you.
Thanks,
Deepa
|
|
|
|
 |
|
 |
Check your conntaction string
Tanveer
WWW.TANVTECH.COM
SOFTWARE ENGINEER
|
|
|
|
 |
|
 |
There doesn't seem to be any problems with the connection string - nothing that is flagged up.
Please see the code I have put in..
public partial class OrderPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string Cn = "Data Source=COLUMBO-019\\SQLEXPRESS;Initial Catalog=Trial;Integrated Security=SSPI";
string Sel = "Select * from ItemTable";
SqlConnection Con = new SqlConnection(Cn);
SqlCommand cmd = new SqlCommand(Sel, Con);
Con.Open();
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("PictureID", typeof(int)));
dt.Columns.Add(new DataColumn("PictureURL", typeof(string)));
dt.Columns.Add(new DataColumn("Title", typeof(string)));
dt.Columns.Add(new DataColumn("DateAdded", typeof(DateTime)));
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
DataRow dr = dt.NewRow();
dr["PictureID"] = Convert.ToInt32(reader["PictureId"]);
dr["PictureURL"] = ResolveUrl("~/Images/" + reader["PictureURL"]);
dr["Title"] = reader["Title"];
dr["DateAdded"] = reader["DateAdded"];
dt.Rows.Add(dr);
}
Con.Close();
GridView1.DataSource = dt;
GridView1.DataBind();
}
It is pretty much the same as above. But I cannot see any display results. Thanks in advance for your help.
|
|
|
|
 |
|
 |
Am I missing a namespace probably? As no connection errors are flagged up.
|
|
|
|
 |
|
 |
Dear Friend
U have done great in project coding but i have confusion that control table data should be kept or it will be auto generate throug query
And also what should be its (CONTROL TABLE) data type int or num or string
Thanking You
Waiting for yr reply
Siddharth_D
|
|
|
|
 |
|
 |
CONTROL TABLE can be int
Yes Auto generate can be used also,but I wanted to specify the image column that is why i use this method.
Tanveer
|
|
|
|
 |
|
 |
Hi
This is nice article.
I have problem with Image data type in SQL Server .
How to add image files into Sql Server database.
Pls help me .
Thnk u
srinivas
|
|
|
|
 |
|
 |
Srini,
Try this link.
http://www.codeproject.com/aspnet/PicManager.asp
Tanveer
|
|
|
|
 |
|
 |
I think you can put cart items in an Arraylist then store in a Session so that you can minimize database space. My point is that you don't need to round trip to DB while updating the shopping cart values and just only hit the DB if the customer will check-out.
.NET, Web Services, Design Patterns, Windows Infrastructure
"Success can be measured not only in achievements, but in lessons learned, lives touched and moments shared along the way."
|
|
|
|
 |
|
 |
Thanks for the comments, It depends on the type of web site you are building, If the user loging and select some items and put it on the shopping cart and next day he want to check out the order.But your idea is also very good , but for temp type shoping cart.
Tanveer
|
|
|
|
 |
|
 |
Hi, I am beginner to .NET, can you guide me how to create a table.
|
|
|
|
 |
|
 |
If you have SQL install just select a data base and select tables and right click on the tables and select create new table.
Tanveer
|
|
|
|
 |
|
 |
I feel your article needs improving upon.
Most notable thing is that you need to wrap your sample code in <pre> tags.
You should then also elaborate on your explanation of the code
This is always tricky when writing articles as some things you think as trivial my be completely new to some readers. It's always hard to get the right balance.
I am going through that same learning curve myself
|
|
|
|
 |
|
 |
Thanks for the comment, This is some part of the project i want to add.Next update i will add more detail.
|
|
|
|
 |
|
 |
cool look forward to the next update keep up the good work, and keep learning
|
|
|
|
 |