怎么将显示出来的数据添加到数据库里的另一张表里
来源:互联网 发布:注意事项网络图片 编辑:程序博客网 时间:2024/04/30 10:21
这是前台<table align="center" border="1" bordercolor="#cccc66" cellpadding="0"
cellspacing="0"
style="width: 513px; height: 355px; font-size: 9pt; background-image: url('file:///G:/mingrisoft/05/Image/例图/购物信息查询.jpg');">
<tr>
<td style="text-align: center">
</td>
<td colspan="3" style="text-align: center">
=== 商品详细信息 ===</td>
</tr>
<tr>
<td colspan="2" rowspan="6" style="text-align: center;">
<asp:Image ID="iGPhoto" runat="server" Height="160px" Width="136px" />
</td>
<td style="width: 100px; text-align: center; height: 30px;">
商 品 ID:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGID" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品名称:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品类别:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGType" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
规格:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGStore" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品价格:</td>
<td style="width: 346px; text-indent: 8pt; height: 30px;">
<asp:TextBox ID="txtGPrice" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
库存量:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGDate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4">
购买数量:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="btnShop" runat="server" Height="23px" onclick="btnShop_Click"
Text="购买" Width="60px" />
</td>
</tr>
<tr>
<td colspan="4">
商品介绍:</td>
</tr>
<tr>
<td colspan="4"
style="height: 134px; vertical-align: top; text-indent: 8pt; text-align: center;">
<asp:TextBox ID="txtGIntro" runat="server" Height="150px" ReadOnly="True"
TextMode="MultiLine" Width="510px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4" style="text-align: right; height: 24px;">
</td>
</tr>
</table>
这是后台
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string ConnSql = System.Configuration.ConfigurationManager.ConnectionStrings["tourismConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnSql);
Conn.Open();
string strid = Page.Request.QueryString["SpecialProduct_ID"];
string sqlstr = "select * from Special_Message where SpecialProduct_ID='" + strid + "'";
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, Conn );
DataSet myds = new DataSet();
myda.Fill(myds, "Special_Message");
DataRowView mydrv = myds.Tables["Special_Message"].DefaultView[0];
txtGID.Text = Convert.ToString(mydrv.Row["SpecialProduct_ID"]);
txtGName.Text = Convert.ToString(mydrv.Row["SpecialProduct_Name"]);
txtGType.Text = Convert.ToString(mydrv.Row["SpecialProduct_Kind"]);
txtGStore.Text = Convert.ToString(mydrv.Row["SpecialProduct_Kind"]);
txtGPrice.Text = Convert.ToString(mydrv.Row["SpecialProduct_Pricet"]);
txtGDate.Text = Convert.ToString(mydrv.Row["SpecialProduct_Quantity"]);
txtGIntro.Text = Convert.ToString(mydrv.Row["SpecialProduct_Charistirastic"]) + "…";
iGPhoto.ImageUrl = Convert.ToString(mydrv.Row["SpecialProduct_Image"]);
}
}
protected void btnShop_Click(object sender, EventArgs e)
{
if (Session["username"] != null)
{
Option.UpdateGoodsOrder(SpecialProduct_ID.Text, Session["username"].ToString(), Convert.ToInt32(TextBox1.Text.Trim()));
}
else
{
Response.Write("<script>alert('对不起,您还没有登陆,只有登陆后您才可以进行购买操作!');</script>");
}
}
}
请问怎样才能将上面的文本框里的数据添加到订单信息表里
cellspacing="0"
style="width: 513px; height: 355px; font-size: 9pt; background-image: url('file:///G:/mingrisoft/05/Image/例图/购物信息查询.jpg');">
<tr>
<td style="text-align: center">
</td>
<td colspan="3" style="text-align: center">
=== 商品详细信息 ===</td>
</tr>
<tr>
<td colspan="2" rowspan="6" style="text-align: center;">
<asp:Image ID="iGPhoto" runat="server" Height="160px" Width="136px" />
</td>
<td style="width: 100px; text-align: center; height: 30px;">
商 品 ID:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGID" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品名称:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品类别:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGType" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
规格:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGStore" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
商品价格:</td>
<td style="width: 346px; text-indent: 8pt; height: 30px;">
<asp:TextBox ID="txtGPrice" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 100px; text-align: center; height: 30px;">
库存量:</td>
<td style="width: 346px; height: 30px;">
<asp:TextBox ID="txtGDate" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4">
购买数量:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="btnShop" runat="server" Height="23px" onclick="btnShop_Click"
Text="购买" Width="60px" />
</td>
</tr>
<tr>
<td colspan="4">
商品介绍:</td>
</tr>
<tr>
<td colspan="4"
style="height: 134px; vertical-align: top; text-indent: 8pt; text-align: center;">
<asp:TextBox ID="txtGIntro" runat="server" Height="150px" ReadOnly="True"
TextMode="MultiLine" Width="510px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4" style="text-align: right; height: 24px;">
</td>
</tr>
</table>
这是后台
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string ConnSql = System.Configuration.ConfigurationManager.ConnectionStrings["tourismConnectionString"].ConnectionString;
SqlConnection Conn = new SqlConnection(ConnSql);
Conn.Open();
string strid = Page.Request.QueryString["SpecialProduct_ID"];
string sqlstr = "select * from Special_Message where SpecialProduct_ID='" + strid + "'";
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, Conn );
DataSet myds = new DataSet();
myda.Fill(myds, "Special_Message");
DataRowView mydrv = myds.Tables["Special_Message"].DefaultView[0];
txtGID.Text = Convert.ToString(mydrv.Row["SpecialProduct_ID"]);
txtGName.Text = Convert.ToString(mydrv.Row["SpecialProduct_Name"]);
txtGType.Text = Convert.ToString(mydrv.Row["SpecialProduct_Kind"]);
txtGStore.Text = Convert.ToString(mydrv.Row["SpecialProduct_Kind"]);
txtGPrice.Text = Convert.ToString(mydrv.Row["SpecialProduct_Pricet"]);
txtGDate.Text = Convert.ToString(mydrv.Row["SpecialProduct_Quantity"]);
txtGIntro.Text = Convert.ToString(mydrv.Row["SpecialProduct_Charistirastic"]) + "…";
iGPhoto.ImageUrl = Convert.ToString(mydrv.Row["SpecialProduct_Image"]);
}
}
protected void btnShop_Click(object sender, EventArgs e)
{
if (Session["username"] != null)
{
Option.UpdateGoodsOrder(SpecialProduct_ID.Text, Session["username"].ToString(), Convert.ToInt32(TextBox1.Text.Trim()));
}
else
{
Response.Write("<script>alert('对不起,您还没有登陆,只有登陆后您才可以进行购买操作!');</script>");
}
}
}
请问怎样才能将上面的文本框里的数据添加到订单信息表里
- 怎么将显示出来的数据添加到数据库里的另一张表里
- mysql 如何用一条SQL将一张表里的数据插入到另一张表
- mysql插入一张表里的数据到另一张表
- mysql把一张表里的数据插入到另一张表里
- mysql 如何用一条SQL将一张表里的数据插入到另一张表 3个例子
- 循环将一张表的数据添加到另一张表,重复数据不添加
- oracle将一个表的多个字段更新到另一张表里面
- 将一个数据库里的表及数据复制到另一个数据库的表里
- 如何把一张表里的数据update到另一张表
- MySQL数据库中,将一张表的数据插入到另一张表的各种情况
- [VB.NET]如何将Access数据库里的a表里的部分数据移到b表里
- sql 表中的数据 导入到另一张表里
- 怎样用SQL Server 2008 SQL语句将Excel数据导入到数据库里指定的表里面?(
- 怎样用SQL Server 2008 SQL语句将Excel数据导入到数据库里指定的表里面
- 数据表的级联删除(删除一张表里的数据,会把另一张表里的数据)
- 将查询结果插入到另一张表的语句怎么写
- oracle中从4个表查询数据并插入到另一张表里 扩展到查询到的数据和其他数据共同插入
- SQL Server大数据导入导出:将一张表的数据导入到另一张表
- android图片切换ImageSwichter的动画切换效果
- 结构体对齐陷阱[plus版]
- SAE PHP 研究(3)
- SIP协议详解(中文)-2
- javascript中的闭包
- 怎么将显示出来的数据添加到数据库里的另一张表里
- SIP协议详解(中文)-3
- 如何让网页上的失效图片,显示默认缺省图片
- IT经典面试题目
- SIP协议详解(中文)-4
- 图片(img标签)的onerror事件
- IOS设计模式学习(2)热身
- 图片(img标签)的onerror事件
- java中ArrayList和LinkedList的区别