private void BindGrid()
{
SqlConnection conn=new SqlConnection(ConfigurationSettings.AppSettings["sql"]);
SqlCommand GetCmd=new SqlCommand("select top 3 * from test order by id desc",conn);
SqlDataReader dr=new SqlDataReader(GetCmd);
conn.Open();
dr=GetCmd.ExecuteReader();
while (dr.Read())
{
username.Text=dr["id"].ToString();
}
conn.Close();
}
{
SqlConnection conn=new SqlConnection(ConfigurationSettings.AppSettings["sql"]);
SqlCommand GetCmd=new SqlCommand("select top 3 * from test order by id desc",conn);
SqlDataReader dr=new SqlDataReader(GetCmd);
conn.Open();
dr=GetCmd.ExecuteReader();
while (dr.Read())
{
username.Text=dr["id"].ToString();
}
conn.Close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货