public List<string> GetProductInfo()
{
List<string> dbProductNames = new List<string>();
try
{
SqlCommand cmd = new SqlCommand("spGetProductNames", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.HasRows && rdr.Read())
{
dbProductNames.Add((string)rdr["RecipeName"]);
}
}
catch (SqlException e)
{
string s = e.Message;
}
finally
{
conn.Close();
conn.Dispose();
}
return dbProductNames;
}
}