0

I am trying to pass a timestamp to sql server where clause but it's not working due to incompatible type.

Can anyone help me? pls..

sqlCmd.Parameters.Add(new SqlParameter("@Timestamp", "0x000000253A0B0FE2"));
Ankit Goel
  • 353
  • 1
  • 4
  • 13

1 Answers1

1

The problem was due to incorrect data types in C# code. Below is the fixed code...

byte[] _timeStamp = BitConverter.GetBytes(0x0);

sqlCmd.Parameters.Add(new SqlParameter("@Timestamp", _timeStamp));

_timeStamp = (byte[])ds.Tables[2].Rows[0][0];
Matt
  • 74,352
  • 26
  • 153
  • 180
Ankit Goel
  • 353
  • 1
  • 4
  • 13
  • Please strive to include as much information in your posts in future. Not everyone is an advanced user. – Matt Oct 21 '15 at 19:21