摘要:
MongoDB的官网是:http://www.mongodb.org/MongoDB最新版本下载在官网的DownLoad菜单下:http://www.mongodb.org/downloads1:解压下在的mongodb数据库2:在bin目录下创建data文件夹,并在data文件夹下创建db和logs文件夹3:启动mongodb服务 进入cmd命令行,切换到bin目录下,执行如下命令 mongod --dbpath=data\db --logpath=data\logs\mongodb.log --port=40031--serviceName "MongoDB" 命令启动 阅读全文
摘要:
mysql -h localhost -u root -p 123456 < F:/hello world/niuzi.sql 阅读全文
摘要:
1:调整where子句中的连接顺序 a:将子查询的放到条件的最前面 b:过滤数据的条件有多到少排列2:避免使用 * 进行全表查询3:尽量将多条SQL语句压缩到一句SQL中4:用Where子句替换Having子句5:在表连接查询的时候使用表的别名6:用Exists代替In7:用表连接代替Exists8:避免在索引上使用计算9:用Union all 代替 Union 阅读全文
摘要:
declare @path varchar(800) declare @name varchar(100) set @name = 'DatabaseName'; set @path = 'D:\DataBaseBack\' + @name + '_' + convert(varchar(50),getdate(),112)+'.bak' backup database @name to disk = @path with noinit,nounload,noskip,stats=10,noformat 阅读全文
摘要:
<%@ WebHandler Language="C#" class="mergeHandler" %>using System; using System.Web; using System.IO; using System.Text;public class mergeHandler : IHttpHandler { private const string CacheKeyFormt = "CacheKey_{0}_{1}_"; public void ProcessRequest(HttpContext conte 阅读全文
摘要:
public void SetValue() { SqlConnection connection = new SqlConnection("ConnectionString"); connection.Open(); SqlTransaction tran = new SqlTransaction(); SqlCommand command = new SqlCommand(); command.Connection = connection; command.Transaction = tran; try { command.CommandText = "in 阅读全文
摘要:
判断缓存是否存在 if (HttpRuntime.Cache[key] == null) { }插入缓存 缓存过期时间为2个小时NoAbsoluteExpiration:相对过期时间,生成缓存后若在没有过期的时间段被取,则过期时间后推10分钟,例如:11:1分钟时生成的 在11:5分钟时被取了,则过期时间为11:15分钟HttpRuntime.Cache.Insert(key.ToUpper(), dic, null,System.Web.Caching.Cache.NoAbsoluteExpiration,TimeSpan.FromMinutes(10));NoSlidingExpirat. 阅读全文
摘要:
/// <summary> /// dataTable转换成Json格式 /// </summary> /// <param name="dt"></param> /// <returns></returns> public static string ToJson(DataTable dt) { if (dt != null && dt.Rows.Count > 0) { StringBuilder jsonBuilder = new StringBuilder(); jsonB 阅读全文
摘要:
static string str = "|add|and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join|"; public static bool DataVerify() { string type = HttpContext.Current.Request.RequestType.ToLower(); bool flag = true; if (type == "post") { for (int i = 0; i < HttpCon 阅读全文
摘要:
public static object Invokewebservice(string url, string @namespace, string classname, string methodname, object[] args) { try { WebClient wc = new WebClient(); Stream stream = wc.OpenRead(url + "?wsdl"); ServiceDescription sd = ServiceDescription.Read(stream); ServiceDescriptionImporter s 阅读全文