 |
static void Main(string[] args)
{
using (EntityConnection cn = new EntityConnection("Name=pubsEntities"))
{
cn.Open();
EntityCommand cmd = cn.CreateCommand();
cmd.CommandText = "SELECT Value c FROM pubsEntities.titles " +
"AS c WHERE c.type = @type";
string type = "business";
cmd.Parameters.AddWithValue("type", type);
EntityDataReader edr = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
while (edr.Read())
Console.WriteLine("{0} - {1}", edr["title_id"], edr["title"]);
edr.Close();
cn.Close();
}
}
|
 |