日期:2014-05-18 浏览次数:21126 次
string ConnectionString = "Data Source=**;user=**;password=**;";//写连接串 OracleConnection conn = new OracleConnection(ConnectionString);//创建一个新连接 try { conn.Open(); OracleCommand cmd1 = conn.CreateCommand(); OracleCommand cmd2 = conn.CreateCommand(); OracleCommand cmd3 = conn.CreateCommand(); OracleCommand cmd4 = conn.CreateCommand(); cmd1.CommandText = "SELECT ..."; cmd2.CommandText = "select ..."; cmd3.CommandText = "select ..."; cmd4.CommandText = "select ..."; DataSet ds1 = new DataSet(); OracleDataAdapter oda1 = new OracleDataAdapter(); oda1.SelectCommand = cmd1; oda1.Fill(ds1); DataSet ds2 = new DataSet(); OracleDataAdapter oda2 = new OracleDataAdapter(); oda2.SelectCommand = cmd2; oda2.Fill(ds2); DataSet ds3 = new DataSet(); OracleDataAdapter oda3 = new OracleDataAdapter(); oda3.SelectCommand = cmd3; oda3.Fill(ds3); DataSet ds4 = new DataSet(); OracleDataAdapter oda4 = new OracleDataAdapter(); oda4.SelectCommand = cmd4; oda4.Fill(ds4); conn.Close(); GridView1.DataSource = ds1.Tables[0].DefaultView; GridView1.DataBind(); GridView2.DataSource = ds2.Tables[0].DefaultView; GridView2.DataBind(); GridView3.DataSource = ds3.Tables[0].DefaultView; GridView3.DataBind(); GridView4.DataSource = ds4.Tables[0].DefaultView; GridView4.DataBind();