Solved

About My ShoppingCart?

Posted on 2004-09-02
9
193 Views
Last Modified: 2010-04-06
hi ,i develop a shopping cart in ASP.Net ,and I found out a problem ,but i dont know how to solve it ,anyone can help me? My prob is :
In my ShoppingCart ,i create a DataTable ,and use NewRow method to add item into it ,and then bind it to DataGrid ,everything is ok ,but how can i add all the item of that DataTable into my OrderItem table .
 In Case adding 1 Item : I create a Store Procedure and then add that item into my table ,it's easy .
  But how can i add (n) Item into my OrderItem ,that's difficult ,please help me ,i waste me alot of time ,thank you so much
0
Comment
Question by:chuong25
9 Comments
 
LVL 2

Expert Comment

by:SeanLWilliams
Comment Utility
Without seeing how your trying to do things ( Ie sections of code )
I would suggest using SQL statements such as    Insert into TABLENAME Select a, b, c, d  from ShoppingCartTableName where ShoppingCartID = XXX  

something like that , obviously need to replace a lot of the variables
0
 
LVL 11

Expert Comment

by:raj3060
Comment Utility
If you are using database then add you data to the database, and retreive it back in order table.
If you are not using database or if you don't want to use database then create an array with all data pass it to the order page.
Let me know if you need more clarification.
--Raj
0
 

Author Comment

by:chuong25
Comment Utility
can you give me an example about an array by C#.THank you so much
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Accepted Solution

by:
raj3060 earned 250 total points
Comment Utility
Never worked on C#, but here is something I found
++++++
<%@ Page Language="C#" Debug="true" %>
<script runat="server">

public void Page_Load(Object sender, EventArgs E) {

            //string[] args = new string[0];
            string[] args = {"one","two"};

            //show how big array is
            ShowArray(args);

            //create a new array and add a string to it
            string[] newArgs = AddStringToArray(args,"add this");

            //show again
            ShowArray(newArgs);

}

public static string[] AddStringToArray(string[] arr, string newItem) {

      //converst array to arraylist
            ArrayList alArgs = new ArrayList(arr);

            //add item to arraylist
            alArgs.Add(newItem);

            //put arraylist back into new array
            string[] newArray = (string[])alArgs.ToArray(typeof(string));

            //send new array back
            return newArray;

}

public static void ShowArray(string[] arr) {
      HttpContext.Current.Response.Write("Array has " + arr.Length + " items:<br/>");
      for(int x=0; x<arr.Length; x++) {
            HttpContext.Current.Response.Write(" " + x + ": " + arr[x] + "<br/>");
      }
      HttpContext.Current.Response.Write("<br/>");
}

</script>
+++++++++++
See if any of these help you.
Are you using ASP?
If you are then you should be able to set the attributes, abd get the attributes.
--Raj
0
 

Assisted Solution

by:Maldini
Maldini earned 250 total points
Comment Utility
I'd suggest this article, has c# code.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndive/html/data11082001.asp

Simply do the batch update over to your db table.
0
 
LVL 11

Expert Comment

by:raj3060
Comment Utility
We did not get response if the suggestions we gave worked or not, I would suggest point split.
-Thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
XML problem with Internet Explorer 7 29
Removing Flash from Website 6 38
Problem to run file 9 90
use of cookies and regulations 1 51
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now