private int UrlThereare(string id) { string sql = "select count(0) from ReleaseInfoWB where title='" + id + "'"; int result = int.Parse(cmd.GetOne(sql).ToString()); return(result); }
/// <summary> /// 查询采集信息(按网址和关键字) /// </summary> /// <returns></returns> public int GetReleaseInfoCount(string sUrl, string keyword) { DataPage firstPage = Finder.util.Comm.GetPageInfo(); string sql = "SELECT count(*) FROM ReleaseInfo WHERE InfoSource ='{0}' and keywords='{1}' and uid between " + firstPage.CurrenPageStartUid + " and " + firstPage.CurrenPageEndUid; sql = string.Format(sql, sUrl, keyword); try { DataBaseServer.MySqlCmd dbobj = new MySqlCmd(); object obj = dbobj.GetOne(sql); int val = 0; int.TryParse(obj.ToString(), out val); return(val); } catch (Exception ex) { //throw new Exception("查询失败,位置:SelReleaseInfo.原因:" + ex.Message); } return(0); }