using System.Data.OleDb;
using System.Data.Common;
OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
con.Open();
OleDbCommand cmd = new OleDbCommand("select Col1 from table", con);
this.GridView1.DataSource = cmd.ExecuteReader();
this.GridView1.DataBind();
OleDbDataAdapter sda = new OleDbDataAdapter("select xinghao from product", con);
con.Open();
DataSet ds = new DataSet();
sda.Fill(ds, "product");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string[] shuzu ;
shuzu = new string[ds.Tables[0].Rows.Count];
shuzu[i] = ds.Tables[0].Rows[i]["xinghao"].ToString();
Response.Write(shuzu[i]);
}
温馨提示:答案为网友推荐,仅供参考