?? searchgoods.ascx.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 control_searchgoods : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!IsPostBack)
//{
// this.bindtogridview();
//}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string 商品編號 = this.txtserachid.Text.ToString();;
SqlConnection con = DB.createConnection();
con.Open();
SqlCommand cmd = new SqlCommand("select * from addgoods where 商品編號='" + 商品編號 + "'", con);
cmd.ExecuteNonQuery();
con.Close();
//string sqlstr = "select * from addgoods where 商品編號 like '%" + this.txtserachid.Text + "'";
//SqlCommand.SelectCommand = sqlstr;
//this.GridView1.DataBind();
}
// private void bindtogridview();
//{
// string 商品編號 = this.txtserachid.Text.ToString();
// SqlConnection con = DB.createConnection();
// SqlDataAdapter sda = new SqlDataAdapter();
// sda.SelectCommand = new SqlCommand("select * from addgoods ", con);
// DataSet ds = new DataSet();
// sda.Fill(ds, "addgoods");
// this.GridView1.DataKeyNames = new string[] { "商品編號" };
// this.GridView1.DataSource = ds.Tables["addgoods"];
// this.GridView1.DataBind();
// }
//protected void txtserachid_TextChanged(object sender, EventArgs e)
//{
//}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -