예제 #1
0
 DataSet GetDataSet(string sql)
 {
     DBConnection dbconn = new DBConnection();
     OleDbConnection connection = dbconn.getConnection();
     connection.Open();
     OleDbCommand cmd = new OleDbCommand(sql, connection);
     OleDbDataAdapter dataAdapter = new OleDbDataAdapter(cmd);
     DataSet ds = new DataSet();
     dataAdapter.Fill(ds);
     cmd.Dispose();
     dataAdapter.Dispose();
     return ds;
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string sql = "SELECT * FROM [user_details] where [ID] = " + Request.QueryString["ID"];
     DataSet ds = new DataSet();
     DBConnection dbconn = new DBConnection();
     OleDbConnection connection = dbconn.getConnection();
     connection.Open();
     OleDbCommand cmd = new OleDbCommand(sql, connection);
     OleDbDataAdapter dataAdapter = new OleDbDataAdapter(cmd);
     dataAdapter.Fill(ds);
     cmd.Dispose();
     dataAdapter.Dispose();
     showuser.DataSource = ds;
     showuser.DataBind();
 }