MongoClient我的c#console应用程序连接到MongoDBhttps://github.com/mongodb/mongo-csharp-driver/releases/tag/v2.0.0-rc0
我的代码
class Program
{
static void Main(string[] args)
{
const string connectionString = "mongodb://localhost:27017";
// Create a MongoClient object by using the connection string
var client = new MongoClient(connectionString);
//Use the MongoClient to access the server
var database = client.GetDatabase("test");
var collection = database.GetCollection<Entity>("entities");
var entity = new Entity { Name = "Tom" };
collection.InsertOneAsync(entity);
var id = entity._id;
}
}
public class Entity
{
public ObjectId _id { get; set; }
public string Name { …Run Code Online (Sandbox Code Playgroud)我有一个Accounts与列的表name, password和email.他们都是类型nvarchar.我写了一个类似的查询
SELECT name, password, ISNULL(email, 'eeee')
FROM Accounts
WHERE name = '" + textBox1.Text + "' AND password ='" + textBox2.Text + "'"
Run Code Online (Sandbox Code Playgroud)
我读了这封电子邮件,reader.getString(2)因为它是nvarchar.
当我从互联网上读取时,如果email是NULL,那么它应该返回eeee.但它说System.boolean不能翻译成System.String.
我怎么能纠正这个?为什么它返回一个布尔值?
问题
我正在尝试将TFS工作空间从“服务器”转换为“本地”。当我更改工作区设置并单击“确定”时,将出现一个标题为“设置工作区位置”的对话框。它显示带有消息“正在创建和填充本地版本表...”的进度条。几秒钟后,另一个对话框将其替换为标题“ Microsoft Visual Studio”和以下消息:
“错误:不是有效的Win32文件时间”
单击确定后,错误对话框消失。工作区位置尚未更改。
我的配置
我正在使用Visual Studio 2013 Update2。我的工作区类型为“私人”,“文件时间”设置为“签入”。
题
是什么引起的,如何解决这个问题,以便可以转换工作空间?