Bilgiler > SqlDataReader Örneği (MS SQL)
SqlDataReader Örneği (MS SQL)
SqlConnection con = new SqlConnection();
SqlCommand com = new SqlCommand();
com.Connection = con;
con.ConnectionString = ConfigurationManager.ConnectionStrings[0].ConnectionString;
com.CommandText = "select id from abokam where enabled=1 and id like '" + drgid + "%' order by id desc";
SqlDataReader dr;
con.Open();
dr = com.ExecuteReader(CommandBehavior.CloseConnection);
while (dr.Read())
{
aktif.Add((int)dr[0]);
}
con.Close();
***