02 2017 档案

摘要:from:http://www.cnblogs.com/gossip/p/4573056.html 一、None of the specified endpoints were reachable 这个异常在创建连接时抛出(CreateConnection()),原因一般是ConnectionFactory参数设置不对,比如HostName、UserName、Password 标准设置: ... 阅读全文
posted @ 2017-02-24 08:38 94cool 阅读(9154) 评论(0) 推荐(0) 编辑
摘要:from:https://my.oschina.net/chiyong/blog/289138 Mongodb 没有传统数据库的group函数,如果分组需要走MapReduce。这种MR与HadoopMR类似。下面看看Mongodb 的分组实现 现在又一张 表它的数据格式如下: { "_id" : 阅读全文
posted @ 2017-02-23 21:12 94cool 阅读(1222) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 分页信息 /// </summary> public class PageInfo<T> { /// <summary> /// 分页信息 /// </summary> public PageInfo() { } /// <summary> /// 总页数 /// 阅读全文
posted @ 2017-02-21 16:31 94cool 阅读(8093) 评论(6) 推荐(0) 编辑
摘要:static async Task CreateIndex() { var client = new MongoClient(); var database = client.GetDatabase("HamsterSchool"); var collection = database.GetCollection("Hamsters"); await collect... 阅读全文
posted @ 2017-02-15 17:40 94cool 阅读(813) 评论(0) 推荐(0) 编辑
摘要:from:https://yq.aliyun.com/articles/8461?spm=5176.7937264.222114.10.s2oqcT 摘要: MongoDB复制集(Replica Set)通过存储多份数据副本来保证数据的高可靠,通过自动的主备切换机制来保证服务的高可用。**但需要注意的时,连接副本集的姿势如果不对,服务高可用将不复存在。** 使用复制集时你需要知道的 Mon... 阅读全文
posted @ 2017-02-15 15:44 94cool 阅读(602) 评论(0) 推荐(0) 编辑
摘要:public async Task CollectionExistsAsync(string collectionName) { var filter = new BsonDocument("name", collectionName); //filter by collection name var collections = await ... 阅读全文
posted @ 2017-02-15 15:21 94cool 阅读(1015) 评论(0) 推荐(0) 编辑
摘要:public void Put(List datas) { try { string tblName = datas[0].beginTime.ToString("yyyy-MM-dd"); MongoCollection table = nu... 阅读全文
posted @ 2017-02-10 17:46 94cool 阅读(2926) 评论(0) 推荐(0) 编辑
摘要:MongoCollection tblCount; if (!db.CollectionExists(tblCountName)) { db.CreateCollection(tblCountName); } tblCount = db.GetCollection(tblCoun... 阅读全文
posted @ 2017-02-09 19:58 94cool 阅读(1895) 评论(7) 推荐(0) 编辑
摘要:这是C#泛型类声明的语法class A 表示 A类接受某一种类型,泛型类型为T,需要运行时传入where表明了对类型变量T的约束关系。 where T:new()指明了创建T的实例时应该具有构造函数。一般情况下,无法创建一个泛型类型参数的实例。 new()约束改变了这种情况,要求类型参数必须提供一个无参数的构造函数。 阅读全文
posted @ 2017-02-08 09:19 94cool 阅读(1025) 评论(0) 推荐(0) 编辑
摘要:如果是MySql数据库,则修改为:DapperExtensions.DapperExtensions.SqlDialect = new MySqlDialect(); DapperExtensions默认是MSSql数据库类型的 阅读全文
posted @ 2017-02-06 11:22 94cool 阅读(608) 评论(2) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示