SQL bit to bool conversion [moved]
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
5fingers wrote:
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value.
Probably by asking it in the correct forum and by reading the message at the top of the page that says... Please do not post programming questions here.
------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
SELECT FORUM[^] FROM CODEPROJECT WHERE FORUM = "DATABASE"
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
-
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value. example: bool? b = (bool?)(row.cells[0].Text) Thanks. If possible one line of code please
I only read newbie introductory dummy books.
modified on Tuesday, August 16, 2011 7:25 AM
Wow, you are long enough here on CP to know the rules, but no, you have to misbehave again and again, and then you complain why you got constantly downvoted? :thumbsdown:
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
-
:thumbsup:
Unrequited desire is character building. OriginalGriff
-
SELECT FORUM[^] FROM CODEPROJECT WHERE FORUM = "DATABASE"
Panic, Chaos, Destruction. My work here is done. Drink. Get drunk. Fall over - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
-
Wow, you are long enough here on CP to know the rules, but no, you have to misbehave again and again, and then you complain why you got constantly downvoted? :thumbsdown:
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
1. create table test(name varchar(20),status bit not null) assume status has value 0 or 1. then fill to a dataset. Bind a gridview directly to dataset. Column status shows true or false on gridview which is ok. To retrieve the status value from gridviewrow.cells[1].text return empty string. Confirm.
I only read newbie introductory dummy books.
-
:thumbsup:
Unrequited desire is character building. OriginalGriff
1. create table test(name varchar(20),status bit not null)
assume status has value 0 or 1. then fill to a dataset.
Bind a gridview directly to dataset.
Column status shows true or false on gridview which is ok.
To retrieve the status value from gridviewrow.cells[1].text return empty string.
Confirm.
I only read newbie introductory dummy books.
-
5fingers wrote:
What is the best precise method of converting bit(0 or 1) from sql(row array text cell) to boolean value.
Probably by asking it in the correct forum and by reading the message at the top of the page that says... Please do not post programming questions here.
------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]
1. create table test(name varchar(20),status bit not null)
assume status has value 0 or 1. then fill to a dataset.
Bind a gridview directly to dataset.
Column status shows true or false on gridview which is ok.
To retrieve the status value from gridviewrow.cells[1].text return empty string.
Confirm.
I only read newbie introductory dummy books.
-
1. create table test(name varchar(20),status bit not null)
assume status has value 0 or 1. then fill to a dataset.
Bind a gridview directly to dataset.
Column status shows true or false on gridview which is ok.
To retrieve the status value from gridviewrow.cells[1].text return empty string.
Confirm.
I only read newbie introductory dummy books.
-
1. create table test(name varchar(20),status bit not null)
assume status has value 0 or 1. then fill to a dataset.
Bind a gridview directly to dataset.
Column status shows true or false on gridview which is ok.
To retrieve the status value from gridviewrow.cells[1].text return empty string.
Confirm.
I only read newbie introductory dummy books.
You need to spend some time with your debugger to figure out exactly where this is going wrong and why. Check all the possible values in your objects at each stage, in particular check whether
gridviewrow.cells[1]
actually has a text value that can be returned.Unrequited desire is character building. OriginalGriff