Currently I am working on Cold Fusion and SQL Server and planning to switch over to ASP.Net and SQL Server.
My Application maintains the ID's of all the tables in VARBINARY(8) datatype of SQL Server.
I have one query in ASP.Net using SQL Server with the same tables.
I have a table called "Books" which has 2 columns "BookID and Title" respectively, where in datatype of BookID is VARBINARY(8) and Title as VARCHAR(64).
Please find the table script with insert statement for the Dummy Data of 5 records below.
-------------Start SQL Script-------------------
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tb_book]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tb_book]
CREATE TABLE [dbo].[tb_book] (
[BookID] [varbinary] (8) NOT NULL ,
[Title] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
insert into tb_book values(0x00000000003DF485, 'ASP')
insert into tb_book values(0x00000000003DF48A, 'JSP')
insert into tb_book values(0x00000000003DF48D, 'ASP.Net')
insert into tb_book values(0x00000000003DF49D, 'VB
insert into tb_book values(0x00000000003DF4A0, 'SQL Server')
----------------End SQL Script-------------------
Now the problem which I am facing is when I select all the records from "Books" tables and list it on page using DataGrid the "BookID" column which has datatype "VARBINARY(8)" is not displayed in grid that means only Title are displayed and not the BookID. And every record has the the Delete image in front of it to delete the record. On click of the Delete image the BookID is passed to some "xyz page" in form of the QueryString to the stored procedure to delete the record.
So my query is I am not getting the BookID to assign it to Delete image.
Can anyone please help me out in working with VARBINARY(8) datatype using ASP.Net. It would be appreciable if anyone could solve the query of mine and even send the code of it.
NOTE: I don't want the solution to convert the VARBINARY(8) value to any Different Datatype in the SQL Server as this is not possible for me as there are a thousands of stored procedures written using the VARBINARY(8) datatype.
PLEASE HELP ME ASAP.