如何插入产品信息产品数量&购物车中Datebase的总价格 [英] how to insert product information Product Quantity & total price in Datebase from shopping Cart

查看:99
本文介绍了如何插入产品信息产品数量&购物车中Datebase的总价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生请提供代码如何解决这个问题如何在数据库中插入数据表格网格视图(购物车)



我的订单项目表是:





sir please provide me code how to solve this problem how to insert data in database form grid view (shopping cart)

my order item table are:


CREATE TABLE [dbo].[tblOrder_Items] (
    [Id] [int] IDENTITY(1, 1) NOT NULL
    ,[orderId] [int] NULL
    ,[product_id] [int] NULL
    ,[quantity] [int] NULL
    ,[discount] [nvarchar](50) NULL
    ,[total_price] [nvarchar](50) NULL
    ,[applydate] [nvarchar](50) NULL
    ,CONSTRAINT [PK_tblOrderdatail] PRIMARY KEY CLUSTERED ([Id] ASC) WITH (
        PAD_INDEX = OFF
        ,STATISTICS_NORECOMPUTE = OFF
        ,IGNORE_DUP_KEY = OFF
        ,ALLOW_ROW_LOCKS = ON
        ,ALLOW_PAGE_LOCKS = ON
        ) ON [PRIMARY]
    ) ON [PRIMARY] GO

推荐答案

foreach (GridViewRow GR in GridView1.Rows)
       {
           if (GR.RowType == DataControlRowType.DataRow)
           {
               string myField = GR.Cells[1].Text;

               // You can also find grid view inside controls here

               TextBox tb = (TextBox)tt.FindControl("TextBox1");
           }
       }


您好,



学习如何插入: http://www.w3schools.com/sql/sql_insert.asp [ ^ ]


这篇关于如何插入产品信息产品数量&购物车中Datebase的总价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆