storing radio button values in database - binary, int or varchar??

H

Hazzard

What is the best way to do this?

Binary with 0 representing off and 1 on?
Int16 with 1 representing first button, 2 the second, 3 ...
varchar with a character values at certain positions in the string
representing radio button values.

Thanks,
-hazz
 
Y

Yan-Hong Huang[MSFT]

Hello Hazz,

I think you could define a structure to store all the data. Then read/write
the structure as binary data from/to database.

http://support.microsoft.com/?id=317017.

Hope it helps.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
--------------------
!From: "Hazzard" <[email protected]>
!Subject: storing radio button values in database - binary, int or varchar??
!Date: Fri, 4 Jul 2003 19:42:06 -0700
!Lines: 11
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <[email protected]>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!NNTP-Posting-Host: dial-209-148-113-113.sonic.net 209.148.113.113
!Path: cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:32383
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!What is the best way to do this?
!
!Binary with 0 representing off and 1 on?
!Int16 with 1 representing first button, 2 the second, 3 ...
!varchar with a character values at certain positions in the string
!representing radio button values.
!
!Thanks,
!-hazz
!
!
!
 
H

Hazzard

Thank you Yan-Hong,

Let me digest the code whose link you supplied - HOW TO: Read and Write a
File to and from a BLOB Column by Using ADO.NET and Visual C++ .NET.

An easy to understand structure at the presentation and business layer
levels and an efficient database storage mechanism.

I appreciate the response and the idea. I will let you know how this evolves
for me.

Greg Hazzard
 
Y

Yan-Hong Huang[MSFT]

Hi,

You are welcome. :)

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
--------------------
!From: "Hazzard" <[email protected]>
!References: <[email protected]>
<[email protected]>
!Subject: Re: storing radio button values in database - binary, int or
varchar??
!Date: Mon, 7 Jul 2003 08:05:08 -0700
!Lines: 66
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <[email protected]>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!NNTP-Posting-Host: dial-209-148-114-118.sonic.net 209.148.114.118
!Path: cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:32717
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!Thank you Yan-Hong,
!
! Let me digest the code whose link you supplied - HOW TO: Read and Write a
!File to and from a BLOB Column by Using ADO.NET and Visual C++ .NET.
!
!An easy to understand structure at the presentation and business layer
!levels and an efficient database storage mechanism.
!
!I appreciate the response and the idea. I will let you know how this
evolves
!for me.
!
!Greg Hazzard
!
!
!!> Hello Hazz,
!>
!> I think you could define a structure to store all the data. Then
!read/write
!> the structure as binary data from/to database.
!>
!> http://support.microsoft.com/?id=317017.
!>
!> Hope it helps.
!>
!> Best regards,
!> yhhuang
!> VS.NET, Visual C++
!> Microsoft
!>
!> This posting is provided "AS IS" with no warranties, and confers no
!rights.
!> Got .Net? http://www.gotdotnet.com
!> --------------------
!> !From: "Hazzard" <[email protected]>
!> !Subject: storing radio button values in database - binary, int or
!varchar??
!> !Date: Fri, 4 Jul 2003 19:42:06 -0700
!> !Lines: 11
!> !X-Priority: 3
!> !X-MSMail-Priority: Normal
!> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!> !Message-ID: <[email protected]>
!> !Newsgroups: microsoft.public.dotnet.framework.aspnet
!> !NNTP-Posting-Host: dial-209-148-113-113.sonic.net 209.148.113.113
!> !Path: cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!> !Xref: cpmsftngxa09.phx.gbl
microsoft.public.dotnet.framework.aspnet:32383
!> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!> !
!> !What is the best way to do this?
!> !
!> !Binary with 0 representing off and 1 on?
!> !Int16 with 1 representing first button, 2 the second, 3 ...
!> !varchar with a character values at certain positions in the string
!> !representing radio button values.
!> !
!> !Thanks,
!> !-hazz
!> !
!> !
!> !
!>
!
!
!
 
H

Hazzard

nvarchar. Save the text string of the radio button list for a descriptive
value of what the option is. A developer friendly solution without any need
for a complicated or space efficient technique.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top