using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
/**********************************/
using System.Data;
using System.Data.SqlClient;
/**********************************/
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string ss = "Data Source = NOAWAY-PC;database = photo;Integrated Security = True;";
string cc = "select * from PHOTO_ALBUMS";
SqlConnection thisConnection = new SqlConnection(ss);
//只能对sql的连接
thisConnection.Open();
SqlCommand thisCommand = new SqlCommand(cc,thisConnection); //相应的sql语句发送到
DataSet ds;
SqlDataAdapter sda = new SqlDataAdapter(cc,thisConnection);
ds = new DataSet();
sda.Fill(ds,"table");
GridView1.DataSource = ds;
GridView1.DataMember = "table";
GridView1.DataBind();
}
}