user3388814
user3388814

Reputation: 11

Attempting to add a Yes/No data type Field in table in Visual Studio 2010

Maybe someone can help me. As part of a college project I am attempting to design a number of tables within MS Visual Studio. We had previously designed these tables using Microsoft Access and one of the fields had a data type of Yes/No. In other words the data which was been saved to the particular field in the table would only contain a yes/No value.

Is there any way to replicate such a data type in Microsoft Visual studio. We are using an SQL server database and I am able to create the table but the only thing I am unable to do is to set the value type to replicate the yes/No value in Access. I would have assumed there would be an option to set values as boolean data type but this option is not present.

To clarify the version of Visual Studio is 2010 Professional and we are building the particular tables in C#.

Can anyone advise on an alternative option to Yes/No which will still return a true/false value or even a 0/1 value would do fine.

Upvotes: 1

Views: 3552

Answers (2)

apomene
apomene

Reputation: 14389

There is the data layer where the data is stored (your DB) and there you can set tinyint or bit as your datatype (assuming you are in MS SQL since you are in in VS an C#) And there is also the presentation and application layer where in (case you are not in WPF) are in the same .cs, where you can define a radiobutton or checkBox control find in VS 2010 toolbox, to show the corresponding data.

Upvotes: 0

pas
pas

Reputation: 98

In SQL Server you can use a bit column: http://msdn.microsoft.com/en-us/ms177603

Upvotes: 1

Related Questions