title: How to insert data in Windows Form Application using c# in VS 2013?
body: <p>I have been trying to insert Data in my Local Database Table using c# in Visual Studio 2013 since long but not able to succeed. What is the role of Data Dictionary? I am getting an exception </p>
  
  <blockquote>
    <p>a first chance exception of type 'system.data.sqlclient.sqlexception' occurred in system.data.dll</p>
  </blockquote>
  
  <p>The Code is :</p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
          private void button1_Click(object sender, EventArgs e)
          {
              try
              {
                  SqlConnection conn = new SqlConnection(@"Data Source=.\SQLExpress;Integrated Security=true;
  User Instance=true;AttachDBFilename=C:\Users\User_name\documents\visual studio 2013\Projects\WindowsFormsApplication1\WindowsFormsApplication1\DataB.mdf;");
  
                  conn.Open();
                  SqlCommand cmd = new SqlCommand("INSERT INTO Table(Id,FirstName, LastName) VALUES(1,'xyz','abc')",conn);
                  cmd.ExecuteNonQuery();
                  conn.Close();
              }
              catch(Exception ee)
              {
                  Console.Write("Exception");
              }
          }
      }
  }
  </code></pre>