// MongoDB server connection string
String connectionstring = configurationmanager. connectionstrings ["concstring"]. tostring ();
Login Server = Login server. Create (connectionstring );
// Connect to the mydb Database
Relational Database DB = server. getdatabase ("mydb ");
// Connect to the testzj set
Collections collection = dB. getcollection ("testzj ");
// Create the object stu1
Bsondocument stu1 = new bsondocument
{
{"Total_variable_characters2", "0018 "},
{"Fixed_weather_station_usaf_master_station_catalog_identifier2", "128970 "},
{"Fixed_weather_station_ncdc_wban_identifier2", "256542 "}
};
// Create the object stu2
Bsondocument stu2 = new bsondocument ();
Stu2.add ("ABC", 2 );
Stu2.add ("EFG", "Hello World ");
// Put the object stu1 and stu2 in the Set students
Collection. insert (stu1 );
Collection. insert (stu2 );
MessageBox. Show ("inserted successfully! ");