I’m test couchbase server and SDK .Net 2.0 DP2 & DP3, to know if (and how) I could do what I need.
I’m interesting on using N1QL on .Net.
N1QL dev preview tester works fine on my couchbase server.
In SDK .Net 2.0 DP2 & DP3 I have some problems: I’ve followed the examples and the documentation, but I cannot get any data from any bucket.
With N1QL I get a success result, but with no row inside (row.count = 0). I’ve tried with “SELECT * FROM :system.buckets” and “SELECT * FROM beer-sample”, but the result is always the same.
With views, and get by key, I get results with succes = false and row = null.
I think I’m wronging somethings but I don’t know what.
////App.config
////DP2
CouchbaseCluster.Initialize(“couchbaseClients/couchbase”);
var cluster = CouchbaseCluster.Get();
using (var bucket = cluster.OpenBucket(“beer-sample”))
{
const string query = “SELECT name FROM beer-sample”;
var results = bucket.Query(query);
if (results.Rows.Count() == 0)
{
Console.WriteLine("No Document Found!");
}
foreach (var row in results.Rows)
{
Console.WriteLine(row);
}
Console.WriteLine("End!");
}
////DP3
ClusterHelper.Initialize(“couchbaseClients/couchbase”);
var cluster = ClusterHelper.Get();
using (var bucket = cluster.OpenBucket())
{
const string query = “SELECT name FROM beer-sample”;
var results = bucket.Query(query);
if (results.Success)
{
if (results.Rows.Count() == 0)
{
Console.WriteLine("No Document Found!");
}
foreach (var row in results.Rows)
{
Console.WriteLine(row);
}
}
Console.WriteLine("End!");
}
Thanks