title: Make Connection to MonetDB using .Net
body: <p>has anyone work wit monetDb and .Net. I am having a hard time to find the right Connection String for the MonetDB using .Net.
  So far I know this from documentation and some other forums.</p>
  
  <p>My monetserver is running on one machine and the .Net client I am running on another machine. </p>
  
  <p>I will have to install both 32bit and 64bit ODBC driver on client machine.</p>
  
  <p>I have to add "Microsoft.Practices.EnterpriseLibrary.Data" reference in my solution.</p>
  
  <p>I have to set build configuration "Platform Target" to value "x64" as my OS is 64bit.</p>
  
  <pre><code>using System;
  using System.Data.Common;
  using System.Data.Odbc;
  using System.Windows.Forms;
  using Microsoft.Practices.EnterpriseLibrary.Data;
  
  namespace WindowsFormsApplication1221
  {
      static class Program
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          [STAThread]
          static void Main()
          {
              try
              {
                  {
                      OdbcConnection cn;
                      OdbcCommand cmd;
                      string MyString;
                  MyString = "Select * from test1";
  
                  cn = new OdbcConnection("dsn=MonetDB;UID=monetdb;PWD=monetdb;");
  
                  cmd = new OdbcCommand(MyString, cn);
  
                  cn.Open();
                  MessageBox.Show("Connected");
  
                  cn.Close();
              }
          }
          catch (Exception e)
          {
              int i = 1;
          }
  
  
          Application.EnableVisualStyles();
          Application.SetCompatibleTextRenderingDefault(false);
          Application.Run(new Form1());
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have installed the latest monetDB on my windows 7 64 os. i have also imprted the sample voyages table that they provided to start learning the monetDB.</p>
  
  <p>I haven't change any server/client configuration and using default setup only.</p>