public void Page_Load(Object sender, EventArgs e) { datacontrol a = (datacontrol)Session["database"]; Driver b = (Driver)Session["driver"]; System.Data.Common.DataAdapter d = a.getUseCar(b.driverid); System.Data.DataSet c = new System.Data.DataSet(); d.Fill(c); Datagride.DataSource = c; Datagride.DataBind(); }
public DataSet GetDataSet(DataAdapter adapter) { int RowCount = 0; DataSet ds = new DataSet(); try { RowCount = adapter.Fill(ds); } catch (Exception e) { Exceptions.LogOnly(e); RowCount = 0; ds.ExtendedProperties["error"] = e; } return ds; }
public void Page_Load(Object sender, EventArgs e) { datacontrol a = (datacontrol)Session["database"]; System.Data.Common.DataAdapter d = a.getAContract(); System.Data.DataSet c = new System.Data.DataSet(); try { d.Fill(c); AlGride.DataSource = c; AlGride.DataBind(); } catch (System.Data.SQLite.SQLiteException) { Response.Write("<script>alert('没有待同意合同');</script>"); } }