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

namespace Command1
{
   class Program
   {
      static void Main(string[] args)
      {
         SqlConnectionStringBuilder cb = new SqlConnectionStringBuilder();
         cb.IntegratedSecurity = true;
         cb.DataSource = @".\SQLExpress";
         cb.InitialCatalog = "TestDB";
         SqlConnection conn = new SqlConnection(cb.ConnectionString);
         conn.Open();

         SqlCommand cmd = conn.CreateCommand();
         cmd.CommandText =
           "INSERT INTO Users(UserName, FirstName, LastName) " +
           "VALUES(@UserName, @FirstName, @LastName)";
         cmd.CommandType = CommandType.Text;

         cmd.Parameters.Add(
           new SqlParameter("@UserName", "Jan"));
         cmd.Parameters.AddWithValue("@FirstName", "Jan");
         cmd.Parameters.AddWithValue("@LastName", "Użytkownik");
         cmd.ExecuteNonQuery();
      }
   }
}
