//public static void selectMember() //{ // string[] member=new string[]{"山水清澈" ,"会飞的佳佳猫","龟山隐真","清风扶金","家有小儿","陈美英的博客","xiaobai1659","最初的地方","他的记忆", // "qazwsx9642","幽谷百合","静静的长椅","煜榕","基度山人","别梦依依","haya01","中浪淘沙","猪猪2002","狂笑三声半","月下荷塘","鹏啸九天","高山临风","宁静致远丫头","缪卡妮", // "喵小姐的博客","静忆","菜叶青虫","子烟小秘","蓝色的千纸鹤","中国青年","聊聊心情","三言两拍","山野农夫","悠然冰心","晨雪新语","四明水人", // "竹影流动","不拘的风","晚礼服","rxxx103","六月的一天","wfhsyy","张老师的博客","点点滴滴的快乐","李凝桦","水吟吟","悠然冰心","力挥之亘","龟山隐真","梧桐树三更雨","慧宁" // ,"妍尘","益达浪子","西门子","灵溪春晓"}; // DataConnection dc = new DataConnection(); // foreach (string name in member) // { // //获取Member用户表的数据 // string sql = "select * from ra_pbMember where LoginName= '" + name + "'"; // //dt = dc.FillDataTable(sql); // DataRow drMember = dc.FillDataRow(sql); // string realName = Convert.ToString(drMember["RealName"]); // // string loginName = Convert.ToString(drMember["LoginName"]); // string ip = Convert.ToString(drMember["LastLoginIP"]); // string face = Convert.ToString(drMember["Face"]); // sql = "INSERT INTO DataTransfer (UserName,PostTime,RealName,IP) VALUES ('" + name + "','" + DateTime.Now + "','" + realName + "','" + ip + "')"; // dc.ExeSql(sql); // } //} public static void delete() { int[] list = new int[] { 10608, 10607, 10606, 10605, 10604, 10603, 10602, 10601, 10600, 10599, 10598, 10597, 10596, 10595, 10594 }; foreach (var deleteId in list) { DataConnection dc = new DataConnection(); string sql1 = "select * from article where unit_id=" + deleteId; DataTable dt = new DataTable(); dt = PostgreHelper.FillDataTable(sql1); foreach (DataRow dr in dt.Rows) { long article_id = Convert.ToInt64(dr["id"]); string sql2 = "delete from article_comment where article_id=" + article_id; PostgreHelper.ExeSql(sql2, "Server=61.153.18.239;Port=5432;User Id=postgres;Password=Zx5p(wFwDXSxaxEHA7yX;Database=db_unit;"); } string sql3 = "delete from article where unit_id=" + deleteId; PostgreHelper.ExeSql(sql3, "Server=61.153.18.239;Port=5432;User Id=postgres;Password=Zx5p(wFwDXSxaxEHA7yX;Database=db_unit;"); } }
public static void DelArticle(int blogId) { string sql = "delete from article where source_art_id=" + blogId; PostgreHelper.ExeSql(sql, PostGreSqlConnectionString); }
public static void DelComment(long articleId) { string sql = "delete from article_comment where article_id=" + articleId; PostgreHelper.ExeSql(sql, PostGreSqlConnectionString); }