public void FirstRecord(void) { ConStr Constring = new ConStr(); String CS = Constring.ConString("DBCS"); using (SqlConnection con = new SqlConnection(CS)) { SqlDataAdapter DA = new SqlDataAdapter("Select * from FeesHead order by ID", con); DataSet DS = new DataSet(); DA.Fill(DS, "FeesHead"); if ( i < DS.Tables["FeesHead"].Rows.Count-1) { i++; // Note that these update the properties on this class. this.CurrentRecordID = DS.Tables["FeesHead"].Rows[i]["ID"].ToString(); this.CurrentRecordFees = DS.Tables["FeesHead"].Rows[i]["Fees"].ToString(); this.CurrentRecordHead = DS.Tables["FeesHead"].Rows[i]["FeesHead"].ToString(); this.CurrentRecordFees = DS.Tables["FeesHead"].Rows[i]["Remarks"].ToString(); } // ... etc., as per your code. } // ... and the rest of the navigation methods: prev, next, last, etc. }
public string getConnectString() { string ConnString; ConStr con = new ConStr(); ConnString = con.getConnectString(); return ConnString; }
internal DataTable GetICD() { DataSet ds = new DataSet(); ConStr sql = new ConStr(); sql.Filltable(ds, "ICD_Mst", "GetAllICD", new SqlParameter[] { }); return(ds.Tables[0]); }
public DataTable getSanYCarInfo() { DataTable dt = new DataTable(); dboperate = new DataBase.DBOperate(); ConStr con = new ConStr(); string ConnString = con.getSANYConnectString(); dboperate.ConnectString = ConnString; string sql = string.Format(@" select b.companyname,b.deliveryname,b.truckid,b.quantity,b.itemno from curout a inner join outmaster b on a.deliveryid=b.deliveryid " ); dt = dboperate.GetDataTable(sql.ToString().Trim()); return dt; }