returning data from SQL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I posted the following question here before, but got no response. Am I
posting it in the right place? If not, please tell me where can I get help on
that subject?
Below is the question:-

I have a windows form that has a group box having 2 check boxes. The form is
bound to a table in a SQL database (I configured the SQL connection, data
adapter, dataset) There is one column on that SQL table that I want when it
has a value of "xxx", when loading the windows from, one of the checkboxes is
checked. I wrote the following code which is obviously wrong. Please help!!

Select Case DataSet_FPIntake.FP_Intake.HomeTypeColumn.Caption
Case "FBH"
ChBox_HomeType.Checked = True
 
Well it is hard to say with this tiny bit of info
but it seems you read out the caption instead of the value wich can be
referenced by the item property of the datatable .item(index or name ) of
the column


or am i missing something here ??

regards

Michel Posseth [MCP]
 
I posted the following question here before, but got no response. Am I
posting it in the right place? If not, please tell me where can I get help
on
that subject?

Can you show us which post, I cannot find anything about it.

Below is the question:-

I have a windows form that has a group box having 2 check boxes. The form
is
bound to a table in a SQL database (I configured the SQL connection, data
adapter, dataset) There is one column on that SQL table that I want when
it
has a value of "xxx", when loading the windows from, one of the checkboxes
is
checked. I wrote the following code which is obviously wrong. Please
help!!

Select Case DataSet_FPIntake.FP_Intake.HomeTypeColumn.Caption
Case "FBH"
ChBox_HomeType.Checked = True

Would you not use a radiobutton, that is more build for that?

Although both you can only bind to a boolean column, that is where they are
made, not for a string.

Cor
 
I tried the item property as you suggested:
Select Case DataSet_FPIntake.FP_Intake.Item(HomeType)
Case "FBH"
ChBox_HomeType.Checked = True

But I got an error message: "HomeType is not declare"

--
TS


m.posseth said:
Well it is hard to say with this tiny bit of info
but it seems you read out the caption instead of the value wich can be
referenced by the item property of the datatable .item(index or name ) of
the column


or am i missing something here ??

regards

Michel Posseth [MCP]


TS said:
I posted the following question here before, but got no response. Am I
posting it in the right place? If not, please tell me where can I get help
on
that subject?
Below is the question:-

I have a windows form that has a group box having 2 check boxes. The form
is
bound to a table in a SQL database (I configured the SQL connection, data
adapter, dataset) There is one column on that SQL table that I want when
it
has a value of "xxx", when loading the windows from, one of the checkboxes
is
checked. I wrote the following code which is obviously wrong. Please
help!!

Select Case DataSet_FPIntake.FP_Intake.HomeTypeColumn.Caption
Case "FBH"
ChBox_HomeType.Checked = True
 
So, you're saying use boolean type in the back-end for all the check boxes
and radio buttons in the front-end. Say I did that, the check boxes will be
checked-off if the boolean column shows "YES" in the database? Or I have to
write codes for that? And if codes are needed, can you send me a sample of it
 
well it should be


Select Case DataSet_FPIntake.FP_Intake.Item("HomeType")
Case "FBH"
ChBox_HomeType.Checked = True

Michel



TS said:
I tried the item property as you suggested:
Select Case DataSet_FPIntake.FP_Intake.Item(HomeType)
Case "FBH"
ChBox_HomeType.Checked = True

But I got an error message: "HomeType is not declare"

--
TS


m.posseth said:
Well it is hard to say with this tiny bit of info
but it seems you read out the caption instead of the value wich can be
referenced by the item property of the datatable .item(index or name ) of
the column


or am i missing something here ??

regards

Michel Posseth [MCP]


TS said:
I posted the following question here before, but got no response. Am I
posting it in the right place? If not, please tell me where can I get
help
on
that subject?
Below is the question:-

I have a windows form that has a group box having 2 check boxes. The
form
is
bound to a table in a SQL database (I configured the SQL connection,
data
adapter, dataset) There is one column on that SQL table that I want
when
it
has a value of "xxx", when loading the windows from, one of the
checkboxes
is
checked. I wrote the following code which is obviously wrong. Please
help!!

Select Case DataSet_FPIntake.FP_Intake.HomeTypeColumn.Caption
Case "FBH"
ChBox_HomeType.Checked = True
 
Thank you for your response, but it didn't work. Are there any white papers I
can read about this particular subject "Binding check boxes/radio buttons to
datatable"? This application I'm working on has a lot of these controls and I
really need to find out how to make it work?
--
TS


m.posseth said:
well it should be


Select Case DataSet_FPIntake.FP_Intake.Item("HomeType")
Case "FBH"
ChBox_HomeType.Checked = True

Michel



TS said:
I tried the item property as you suggested:
Select Case DataSet_FPIntake.FP_Intake.Item(HomeType)
Case "FBH"
ChBox_HomeType.Checked = True

But I got an error message: "HomeType is not declare"

--
TS


m.posseth said:
Well it is hard to say with this tiny bit of info
but it seems you read out the caption instead of the value wich can be
referenced by the item property of the datatable .item(index or name ) of
the column


or am i missing something here ??

regards

Michel Posseth [MCP]


"TS" <[email protected]> schreef in bericht
I posted the following question here before, but got no response. Am I
posting it in the right place? If not, please tell me where can I get
help
on
that subject?
Below is the question:-

I have a windows form that has a group box having 2 check boxes. The
form
is
bound to a table in a SQL database (I configured the SQL connection,
data
adapter, dataset) There is one column on that SQL table that I want
when
it
has a value of "xxx", when loading the windows from, one of the
checkboxes
is
checked. I wrote the following code which is obviously wrong. Please
help!!

Select Case DataSet_FPIntake.FP_Intake.HomeTypeColumn.Caption
Case "FBH"
ChBox_HomeType.Checked = True
 
Ts,

If you place two radiobuttons in a groupbox, bind the value of one of those
to your boolean value of your database, than most of your work is done.

In your database than the value is by instance for Man True and Woman False.

If you use something as man and woman in your database, than you have to
use the bindingevents to change that to a boolean or better checked = true

I hope this helps,

Cor
 

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

Back
Top