//执行一条sql语句,让文章点击次数增加。
1.要先写引用语句,然后才能使用类。
         using System.Data.SqlClient;

 

2.执行sql语句把点击率加1。

 
SqlConnection myconn = new SqlConnection(ConfigurationManager.ConnectionStrings["BaseConnectionString"].ConnectionString);

 myconn.Open();

 string sql = "update set hits=hits+1 where ArticleID=" + Request.QueryString["ArticleID"];

 SqlCommand mycommand = new SqlCommand(sql, myconn);

 mycommand.ExecuteNonQuery();

相关文章:

  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
  • 2021-09-07
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案