title: Data Migration from SQL Server to mongodb Using C#
body: <p>I want to migrate my tables from SQL Server to MongoDB. I use below code and it is working fine:</p>
  
  <pre><code>string strQueryInline = "select * from "+ddl_table.SelectedValue +"";
  SqlDataAdapter adpt = new SqlDataAdapter(strQueryInline, con);
  DataTable dt = new DataTable();
  adpt.Fill(dt);
  
  var collection = db.GetCollection&lt;BsonDocument&gt;(txt_value.Text);
  
  try
  {
      foreach (DataRow dr in dt.Rows)
      {
          BsonDocument bson = new BsonDocument();
  
          for (int i = 0; i &lt; dr.ItemArray.Count(); i++)
          {
              bson.Add(dr.Table.Columns[i].ColumnName, dr[i].ToString());
          }
          collection.Insert(bson);
      }
  }
  </code></pre>
  
  <p>But the problem is that it is taking same name and column name as in SQL Server. But I want to use a different name for the table and some different names for the fields in the mongo collection.. I searched a few links but I am not able to reach the exact solution... </p>
  
  <p>plz suggest something..</p>