未于信任SQL Server连接,大家帮我看看错在那了?谢谢
zkkxy 2008-07-17 01:20:16 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 Default14 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn=new SqlConnection();
conn.ConnectionString = "Server=localhost;Database=youbian;UID=sa;Pwd=";
conn.Open();
string strSql="select*from youbian where quhao='quhao.Text'";
SqlCommand MyCommand=new SqlCommand(strSql,conn);
SqlDataReader MyReader=MyCommand.ExecuteReader();
Label2.Text = MyReader.GetString(1);
conn.Close();
}
}