I am working on a DataTable Class so that I can insert a product from my Products.aspx page and read the items from my DataTable into a Gridview on my ShoppingCart.aspx page.
In my first step, I added one method to my class called CreateShoppingCartDataTable.
Here is the code from step 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
/// <summary>
/// Summary description for ShoppingCart
/// </summary>
public class ShoppingCart
{
public ShoppingCart()
{
//
// TODO: Add constructor logic here
//
}
public void CreateShoppingCartDataTable()
{
DataTable UBOcartTable = new DataTable("UBOcart");
//
UBOcartTable.Columns.Add("ID", typeof(int));
UBOcartTable.Columns["ID"].AutoIncrement = true;
UBOcartTable.Columns["ID"].AutoIncrementSeed = 1;
...
Go to the complete details ...