using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace demo3
{
public partial class SelectAll : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//1连接字符串
string constr = "data source=.;initial catalog=School;User ID=sa;Password=admin";
//2创建连接对象
using (SqlConnection con = new SqlConnection(constr))
{
//con.ConnectionString = constr;
//打开连接
//拼接sql语句
string sql = "select * from Student";
//3创建命令对象
using (SqlCommand cmd = new SqlCom