public Verbinding GetVerbindingbyId(long id) { string sql = "Select * from Verbinding where id=@id"; List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("id", id.ToString()) }; DataSet results = ExecuteSql(sql, parameters); Verbinding v = null; if (results != null && results.Tables[0].Rows.Count > 0) { v = DataSetParser.DataSetToVerbinding(results, 0); } return(v); }
public List <Verbinding> GetAllVerbindingen() { string sql = "Select * from dbo.verbinding"; List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >(); DataSet results = ExecuteSql(sql, parameters); List <Verbinding> verbindingen = new List <Verbinding>(); if (results != null) { for (int x = 0; x < results.Tables[0].Rows.Count; x++) { Verbinding v = DataSetParser.DataSetToVerbinding(results, x); verbindingen.Add(v); } } return(verbindingen); }