public Winkel GetWinkel(string naam) { Winkel w = null; string sql = @"SELECT naam, locatie, awards FROM Winkel WHERE Naam= :Naam"; try { conn.Open(); OracleCommand cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("Naam", OracleDbType.Varchar2, naam, ParameterDirection.Input); OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { w = new Winkel(reader.GetOracleString(0).ToString(), reader.GetOracleString(1).ToString(), reader.GetOracleString(2).ToString(), new List <WinkelReview>()); } } catch { } finally { conn.Close(); } return(w); }
public Winkel GetWinkel(string naam) { Winkel w = null; string sql = @"SELECT naam, locatie, awards FROM Winkel WHERE Naam= :Naam"; try { conn.Open(); OracleCommand cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("Naam", OracleDbType.Varchar2, naam, ParameterDirection.Input); OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { w = new Winkel(reader.GetOracleString(0).ToString(), reader.GetOracleString(1).ToString(), reader.GetOracleString(2).ToString(), new List<WinkelReview>()); } } catch { } finally { conn.Close(); } return w; }