童言无忌,不懂就问...........数据库.....
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace index
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button topost;
protected System.Web.UI.WebControls.TextBox userpwd;
protected System.Web.UI.WebControls.TextBox username;
protected System.Data.SqlClient.SqlConnection sqlConnection1;
protected System.Data.SqlClient.SqlCommand sqlCommand1;
private void Page_Load(object sender, System.EventArgs e)
{
SqlConnection sqlConn=new SqlConnection ("server=soft.;database=employee;userid=sa;password=123;");
SqlCommand sqlComm=new SqlCommand("select * from productnews ",sqlConn);
//String aa=username.Text;
//this.Response.Write( SqlCommand );
//this.Response.End();
sqlConn.Open();
SqlDataReader dr=sqlComm.ExcuteReader();
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.topost.Click += new System.EventHandler(this.topost_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void topost_Click(object sender, System.EventArgs e)
{
}
}
}
希望朋友们,帮我改改哦