using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string ConStr = "server=(local);user id=myzf;pwd=123456;database=SQL_Data";
        SqlConnection con = new SqlConnection(ConStr);
        string SqlStr = "select 仓库.仓库号,城市,面积,创建时间,职工号,姓名,性别,工资 from  仓库 inner join 职工 on  职工.仓库号=仓库.仓库号 ";
        SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con);
        con.Open();
        DataSet ds = new DataSet();
        ada.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        con.Close();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        string ConStr = "server=(local);user id=myzf;pwd=123456;database=SQL_Data";
        SqlConnection con = new SqlConnection(ConStr);
        string SqlStr = "select 仓库.仓库号,城市,面积,创建时间,职工号,姓名,性别,工资 from  仓库  left  join 职工 on  职工.仓库号=仓库.仓库号 ";
        SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con);
        con.Open();
        DataSet ds = new DataSet();
        ada.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        con.Close();
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        string ConStr = "server=(local);user id=myzf;pwd=123456;database=SQL_Data";
        SqlConnection con = new SqlConnection(ConStr);
        string SqlStr = "select 仓库.仓库号,城市,面积,创建时间,职工号,姓名,性别,工资 from  仓库  right  join 职工 on  职工.仓库号=仓库.仓库号 ";
        SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con);
        con.Open();
        DataSet ds = new DataSet();
        ada.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        con.Close();
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        string ConStr = "server=(local);user id=myzf;pwd=123456;database=SQL_Data";
        SqlConnection con = new SqlConnection(ConStr);
        string SqlStr = "select 仓库.仓库号,城市,面积,创建时间,职工号,姓名,性别,工资 from  仓库  full  join 职工 on  职工.仓库号=仓库.仓库号 ";
        SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con);
        con.Open();
        DataSet ds = new DataSet();
        ada.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        con.Close();
    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
        string ConStr = "server=(local);user id=myzf;pwd=123456;database=SQL_Data";
        SqlConnection con = new SqlConnection(ConStr);
        string SqlStr = "select 仓库.仓库号,城市,面积,创建时间,职工号,姓名,性别,工资 from  仓库 inner join 职工 on  职工.仓库号=仓库.仓库号 ";
        SqlDataAdapter ada = new SqlDataAdapter(SqlStr, con);
        con.Open();
        DataSet ds = new DataSet();
        ada.Fill(ds);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        con.Close();
    }
}
