#region course selected index private void CB_Course_SelectedIndexChanged(object sender, EventArgs e) { coursewisereport(); } #endregion
#region grid coursewisereport private void coursewisereport() { try { objdatabaseclass = new DataBaseClass(); objstudentlistclass = new property_function_class.StudentListClass(); objstudentlistclass.COURS = CB_Course.Text.Trim(); dataset = objstudentlistclass.Getcoursewisereport(); dbBindSource.DataSource = dataset; DbGrid.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); DbGrid.DataSource = dbBindSource; } catch { MessageBox.Show("selected data not in db"); } } #endregion
#region getcoursewisereport function public DataSet Getcoursewisereport() { DataBaseClass objdatabaseclass = new DataBaseClass(); dataset = new DataSet(); dataset = objdatabaseclass.GetDataset(string.Format("select studentid,name,nameofgud,location,mobile from registration where course='" + course + "'")); return dataset; } #endregion
public DataSet GetDataset(string ProcedureName) { try { Objcommand = new OracleCommand(ProcedureName, Objconnection); Objcommand.CommandType = CommandType.Text; // Handle the parameters Objadapter = new OracleDataAdapter(Objcommand); objcommandbuilder = new OracleCommandBuilder(Objadapter); Objdataset = new DataSet(); Objdataset.Locale = System.Globalization.CultureInfo.InvariantCulture; Objadapter.Fill(Objdataset); } catch (Exception Objerrormessage) { throw Objerrormessage; } finally { //release all resource of connection object Objconnection.Dispose(); } return Objdataset; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)