protected void ButtonTest_Click(object sender, EventArgs e) { Roo d = new Roo() { cookTime = cooktime.Text, datePublished = datepublished.Text, description = description.Text, image = imageurl.Text, url = url.Text, ingredients = ingridients.Text, name = name.Text, prepTime = preptime.Text, recipeYield = recipeyield.Text, source = source.Text, _id = new Id() { oid = name.Text }, }; var b = JsonConvert.SerializeObject(d); if (b != "") { var a = sc.Add(b); if (a == "1") { Response.Write("Added"); } else { Response.Write("Name already Added"); } } }
protected void Page_Load(object sender, EventArgs e) { //1.Connect To Server const string ConnectionString = "mongodb://*****:*****@"/","")); // // var d = HttpUtility.HtmlDecode(jsonText.Replace(@"\", "")); // var asss = JsonConvert.DeserializeObject<Ufo>(a); // g+= asss.sighted_at ; // // break; // // ufo.Insert(asss); // //// Response.Write(asss.description); // } // Response.Write(g); //} //ufo.Insert(new Ufo() //{ // description = "dsd", // duration = "ds", // reported_at = "dsad", // shape = "dsad", // sighted_at = "fsf" //}); ///// var bsonDoc = BsonDocument.Parse(fString); //13.Data Grid // var posts = blog.GetCollection<Roo>("Recipe"); //// var searchQuery = Query.EQ("someName", "someValue"); // you can place any search condition here // //if you want all documents from collection use FindAll // var cursor = posts.FindAll(); // cursor.SetLimit(50); // you can specify limit // // set sort orders // cursor.SetSortOrder(SortBy.Ascending("name")); // var resultList = cursor.ToList(); // GridView1.DataSource = resultList; // GridView1.DataBind(); MapReduce(); }