Hi all
I just create my first stored procedures
I am using that one in the C# now related to command I have some question that want to use for adding the parameter in the command.
.Add
or
.AddWithValue



C# Code:
  1. private DatabaseHelper dataBaseHelper = new DatabaseHelper("SQLServer");
  2. public string Name
  3.     {
  4.         get
  5.         {
  6.             return _Name;
  7.         }
  8.         set
  9.         {
  10.             _Name = value;
  11.         }
  12.     }
  13.  
  14.     public string LastName
  15.     {
  16.         get
  17.         {
  18.             return _LastName;
  19.         }
  20.         set
  21.         {
  22.             _LastName = value;
  23.         }
  24.     }
  25.  
  26.  System.Data.SqlClient.SqlCommand sqlCommand = new System.Data.SqlClient.SqlCommand();
  27.  sqlCommand = dataBaseHelper.ReturnStoredProcedureCommand();
  28.  
  29. //Now what TO USE this code
  30.  
  31.  sqlCommand.Parameters.Add("@Name", SqlDbType.VarChar).Value = Name;
  32.             sqlCommand.Parameters.Add("@LastName", SqlDbType.VarChar).Value = LastName;
  33.  
  34. //oR this code
  35.  
  36. sqlCommand.Parameters.AddWithValue("@Name",Name);
  37.             sqlCommand.Parameters.AddWithValue("@LastName",LastName);
  38.  
  39.  sqlCommand.ExecuteNonQuery();

Please tell me also that where I Pass the stored procure name??

Thanks