oracle .net c# query code example
Example: oracle c# select query
public List<Donor> Get()
{
List<Donor> donors = new List<Donor>();
string query;
OracleCommand cmd;
OracleDataReader reader;
query = "SELECT * FROM ldhc_accounts l JOIN donors d ON l.donor_id = d.id";
conn.Open();
cmd = new OracleCommand(query, conn);
reader = cmd.ExecuteReader();
while (reader.Read())
{
Donor d = new Donor();
{
d.DonorId = Convert.ToInt32(reader["id"]);
d.FName = reader["fname"].ToString();
donors.Add(d);
}
}
conn.Close();
return donors;
}