title: mapping c# method parameters to sql stored procedure parameters
body: <p>i am sending parameters from c# method to sql server stored procedure like this:</p>
  
  <pre><code>    public void YENI_ALM_SIFARISI_AC(
          decimal TEKLIF_BEDELI2,
          string REFERANS_NO,
          string CARIKOD,
          string CARIAD,
          string ACIKLAMA,
          int SUB_ID,
          int DETAY_ID,
          string DETAY,
          decimal SUB_TEKLIF,
          decimal QIYMET,
          string OLCU_VAHIDI,
          decimal IS_HECMI
          )
      {
          string CS = ConfigurationManager.ConnectionStrings["Sumqayit"].ConnectionString;
          using (SqlConnection con = new SqlConnection(CS))
          {
              SqlCommand cmd = new SqlCommand("YENI_ALM_SIFARISI_AC", con);
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.Parameters.AddWithValue("@TEKLIF_BEDELI2",TEKLIF_BEDELI2);
              cmd.Parameters.AddWithValue("@REFERANS_NO",REFERANS_NO);
              cmd.Parameters.AddWithValue("@CARIKOD",CARIKOD);
              cmd.Parameters.AddWithValue("@CARIAD",CARIAD);
              cmd.Parameters.AddWithValue("@ACIKLAMA",ACIKLAMA);
  
              cmd.Parameters.AddWithValue("@SUB_ID",SUB_ID);
              cmd.Parameters.AddWithValue("@DETAY_ID",DETAY_ID);
              cmd.Parameters.AddWithValue("@DETAY",DETAY);
              cmd.Parameters.AddWithValue("@SUB_TEKLIF",SUB_TEKLIF);
              cmd.Parameters.AddWithValue("@QIYMET",QIYMET);
              cmd.Parameters.AddWithValue("@OLCU_VAHIDI",OLCU_VAHIDI);
              cmd.Parameters.AddWithValue("@IS_HECMI",IS_HECMI);
  
              con.Open();
              int DataID = (int)cmd.ExecuteScalar();
              JavaScriptSerializer js = new JavaScriptSerializer();
              Context.Response.Write(js.Serialize(DataID));
              //cmd.ExecuteNonQuery();
              con.Close();
          }
      }
  </code></pre>
  
  <p>it seems that i copy and paste the same parameter names both on void parameters and sqlCommand parameters. is there any way to map these parameters so that i will not copy and paste these parameters?</p>