Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 13th, 2003, 04:18 AM
Registered User
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to s_chirags Send a message via Yahoo to s_chirags
Default ASP.Net (Varbinary)

Hello All,

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

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.Net')
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.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Varbinary(max) performance issue musman0047 SQL Language 0 May 8th, 2008 08:20 PM
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
Storing data in a varbinary field in SQL mswombat Java Basics 2 February 9th, 2007 08:03 AM
retrieve varbinary using StoredProc with OUTPUT ag19702004 ADO.NET 0 November 30th, 2005 01:37 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.