Can't Update Record to Sql Server Database Using Stored Procedure in C# -


I have a problem updating my records in the SQL Server database using the stored procedure in C #.

I have a stored procedure designated to record time with an employee Outfin and how it is coded:

  process dbo.Outfin (@EmpRec int, @ time varchar (11)) updated EmpRec set outfin = @ time where EmpRec = @EmpRec closing  

and in this way I apply it to my program I:

  CMD = new SQL Commands (SCMD, Con); Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.Add ("@EmpRec", SqlDbType.Int) .Value = Recordholder; Cmd.Parameters.Add ("@time", SqlDbType.VarChar) .Value = label6.Text; Cmd.ExecuteNonQuery ();  

label6.Text there dateTime.Now.ToLongTimeString () is giving me the value of hh: mm: ss AM

This code will only be executed if is System.DateTime.Now > 5:30:00 pm and <12: 00: 00 am. i can not see anything wrong with the code, but it will update in database. holds the record holder when EmpRec gets the record before I run this code.

Help people! Thanks! A good day!

What is the record holder here?

To use the command parameter in this way, the back code

  CMD = new SQL Commands (SCMD, Con); Cmd.CommandType = CommandType.StoredProcedure; Cmd.Parameters.AddWithValue ("@ EmpRec", recordholder); Cmd.Parameters.AddWithValue ("@time", label 6.text); Cmd.ExecuteNonQuery ();  

Comments