SqlCommand myda=new SqlCommand("select a.考场,b.座号 from (select number '考场' from master.dbo.spt_values where type='P' and number between 1 and 2) a cross join (select number '座号' from master.dbo.spt_values where type='P' and number between 1 and 30) b", con);
SqlDataAdapter myda = new SqlDataAdapter("select a.考场,b.座号 from (select 考场 from tb2 where 考场 between 1 and 2) a cross join (select 座号 from tb2 where 座号 between 1 and 30) b", con);
DataSet da = new DataSet();
myda.Fill(da);
GridView1.DataSource = da.Tables[0];
GridView1.DataBind();