using System;
using System.Data;
using System.Configuration;
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.Sql;
using System.Data.SqlClIEnt;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ShowData();
}
}
/// <summary>
/// 確定
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Btn_ok_Click(object sender, EventArgs e)
{
ShowData();
}
/// <summary>
/// 訪問sqlserver2005 數據庫存數過程
/// </summary>
public void ShowData()
{
SqlConnection Con = new SqlConnection();
Con.ConnectionString = System.Configuration.ConfigurationManager.APPSettings["StrCon"].ToString();
//text 存儲過程名
SqlCommand cmd = new SqlCommand("test",Con);
Con.Open();
cmd.CommandType = CommandType.StoredProcedure;
//@dd 存儲過程中輸入的參數
cmd.Parameters.Add("@dd",SqlDbType.VarChar,3000);
cmd.Parameters["@dd"].Value = this.txt_Message.Text.Trim().ToString();
DataSet ds = new DataSet();
SqlDataAdapter Sda = new SqlDataAdapter(cmd);
Sda.Fill(ds);
this.ShowList.DataSource = ds;
this.ShowList.DataBind();
}
}