📄 sellershopinfo.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class SellerShopInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
string str = "insert into Shop(CoalID, SellerID, BuyName, BuyTotal, BuyMoney) values(" + Convert.ToInt32(TextBox1.Text) + "," + Request.QueryString["SellerID"]
+ ",'" + TextBox2.Text + "'," + Convert.ToInt32(TextBox3.Text) + "," + Convert.ToInt32(TextBox4.Text) + ")";
SqlCommand myCommand = new SqlCommand(str, myConnection);
try
{
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand.Dispose();
}
catch (SqlException ex)
{
Response.Write("Error:" + ex.Message);
}
finally
{
myConnection.Dispose();
Response.Redirect("SellerShopInfo.aspx?SellerID=" + Session["SellerID"]);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -