title: query mongodb using c sharp in asp.net
body: <p>I'm trying to query MongoDB database collection documents using asp.net form.
  I'm getting an error - The type or namespace name 'BsonDocument' could not be found (are you missing a using directive or an assembly?)</p>
  
  <p>I looked at the similar questions posted online, but the part that I don't understand is the input required between the angled brackets - i.e DB.GetCollection. The VisualStudio context show that document type is expected.</p>
  
  <p>Here is what I'm working with:</p>
  
  <p>OS is Windows 2012R2
  MongoDB version is 3.2.3
  database name is "SignalPool"
  collection name is "L1Signal_Pool_Active"</p>
  
  <p>example of a document record</p>
  
  <p>{ 
      "_id" : ObjectId("58ec2e125c57ef0d142d3a35"), 
      "L1Name" : "equipment01", 
      "updatedate" : ISODate("2017-04-11T01:14:58.000+0000"), 
      "enddate" : null, 
      "timespan" : 0.0, 
      "signalname" : "MANUAL", 
      "value" : null, 
      "filter" : null, 
      "TypeID" : null, 
      "Judge" : null, 
      "Error" : null, 
      "Warning" : null
  }</p>
  
  <pre><code>using MongoDB.Driver;
  using MongoDB.Bson;
  
  protected void btnShowSignal_Click(object sender, EventArgs e)
          {
              var conString = "mongodb://l92.168.2.100:27017";
              var Client = new MongoClient(conString);
              var DB = Client.GetDatabase("SignalPool");
              var collection = DB.GetCollection&lt;BsonDocument&gt;("L1Signal_Pool_Active");
              Response.Write(DB.GetCollection&lt;BsonDocument&gt;("L1Signal_Pool_Active"));
  
  
          }
  </code></pre>