日期:2014-05-17  浏览次数:20709 次

数据库与C#得连接
怎样用数据库与C#得连接得知识来做QQ登陆程序?

------解决方案--------------------
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.SqlClient;

public partial class _Default : System.Web.UI.Page 
{
protected void Page_Load(object sender, EventArgs e)
{
string connStr = System.Configuration.ConfigurationManager.ConnectionStrings["aaConnectionString"].ToString();
SqlConnection conn = new SqlConnection(connStr);
conn.Open();
Response.Write("数据库连接成功!");

}
}