none
Adding Timestamp column in Datatable RRS feed

  • Question

  • I have an Sp which takes a userdefinedtabletype as one of the parameter,and now i need to call this Sp from my c# code. I created a dbml file and i created a class which simulates my userdefinedtabletype in DB. Now the issue is there is a column named **version** which of type TMESTAMP is present in the Udtt in SP And the structure of udtt in DB is as follows.

    CREATE TYPE dbo.sampletype TABLE as

    ID INT NULL,

    Name String NULL,

    Version TIMESTAMP NULL

    Now i need to pass udtt thru c# code so i created a datatable and added column **Version** with type as byte[].Im sending the value as NULL. Now when i call SP using classic ADO.net(using cmdparameters,SqlExecuteReader) im getting the below error.. Cannot insert value to timestamp column.

    • Edited by shiv455 Wednesday, December 7, 2011 2:26 AM improving format
    Wednesday, December 7, 2011 2:17 AM

Answers