Click here to Skip to main content
13,251,760 members (27,059 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Stats

76.1K views
4K downloads
25 bookmarked
Posted 30 Jan 2012

MongoDB with C#.NET

, 30 Jan 2012
This article demonstrates how to get started with MongoDB in C#.NET
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MongoDB2.Model;

namespace MongoDB2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        
        private void btnCreateData_Click(object sender, EventArgs e)
        {
            MyCompany.CreateData();
        }

        private void btnGetDepartments_Click(object sender, EventArgs e)
        {
            dataGridView1.DataSource = MyCompany.GetDepartments();
        }

        private void btnGetEmployees_Click(object sender, EventArgs e)
        {
            dataGridView1.DataSource = MyCompany.GetEmployees();
        }

        private void btnDeleteDepartments_Click(object sender, EventArgs e)
        {
            MyCompany.DeleteDepartments();
        }

        private void btnDeleteEmployees_Click(object sender, EventArgs e)
        {
            MyCompany.DeleteEmployees();
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Muhammad-Idrees-1
Software Developer (Senior) Support Services Company Ltd.
Pakistan Pakistan
Karachi - Pakistan.
http://idreesdotnet.blogspot.com/

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 30 Jan 2012
Article Copyright 2012 by Muhammad-Idrees-1
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid