using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

namespace InsertFromClient2
{
  class Program
  {
    static void Main(string[] args)
    {
      //code to insert data from client
      string connStr = GetConnectionStringFromConfigFile();
      using (SqlConnection conn = new SqlConnection(connStr))
      using (SqlCommand cmd =
        new SqlCommand("insert into test values ('testdata')", conn))
      {
        conn.Open();
        int rows_affected = cmd.ExecuteNonQuery();
      }  // Dispose called on cmd and conn here
    }

    static string GetConnectionStringFromConfigFile()
    {
      // for now, just return the string
      return "server=.;integrated security=sspi;database=test";
    }
  }
}
