473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

returning data from SQL

TS
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
Nov 23 '05 #1
7 1029
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" <TS@discussions.microsoft.com> schreef in bericht
news:F6**********************************@microsof t.com...
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

Nov 23 '05 #2
>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
Nov 23 '05 #3
TS
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" wrote:
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" <TS@discussions.microsoft.com> schreef in bericht
news:F6**********************************@microsof t.com...
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


Nov 23 '05 #4
TS
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
--
TS
"Cor Ligthert [MVP]" wrote:
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

Nov 23 '05 #5
well it should be
Select Case DataSet_FPIntake.FP_Intake.Item("HomeType")
Case "FBH"
ChBox_HomeType.Checked = True

Michel

"TS" <TS@discussions.microsoft.com> schreef in bericht
news:90**********************************@microsof t.com...
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" wrote:
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" <TS@discussions.microsoft.com> schreef in bericht
news:F6**********************************@microsof t.com...
>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


Nov 23 '05 #6
TS
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" wrote:
well it should be
Select Case DataSet_FPIntake.FP_Intake.Item("HomeType")
Case "FBH"
ChBox_HomeType.Checked = True

Michel

"TS" <TS@discussions.microsoft.com> schreef in bericht
news:90**********************************@microsof t.com...
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" wrote:
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" <TS@discussions.microsoft.com> schreef in bericht
news:F6**********************************@microsof t.com...
>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


Nov 23 '05 #7
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
Nov 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
2
by: matthias_k | last post by:
Hello, I'm wondering if returning const references to a class member is generally faster than returning a copy of the object. Consider this code: class A { std::string data; public:
10
by: Fraser Ross | last post by:
I need to know the syntax for writing a reference of an array. I haven't seen it done often. I have a class with a member array and I want a member function to return an reference to it. ...
6
by: Generic Usenet Account | last post by:
Is it okay to return a local datastructure (something of type struct) from a function, as long as it does not have any pointer fields? I think it is a bad idea, but one of my colleagues does not...
1
by: Randy | last post by:
Hello, I have a web service in which I'm doing a query to an Access database and returning the resulting XML data when I do the return from the service... public string AOS_Data(string sql) {...
1
by: John Chorlton | last post by:
I've been attempting to pass a chunk of data back from a child Windows form using public properties on the form and have been getting some odd errors. I wanted to return a row of data to avoid...
5
by: Jim Murphy | last post by:
In creating a C# web service, I am having trouble returning a DataTable object as the result of a web method. I have no problem returning native types like string or int, but cannot return a .NET...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
23
by: pauldepstein | last post by:
Below is posted from a link for Stanford students in computer science. QUOTE BEGINS HERE Because of the risk of misuse, some experts recommend never returning a reference from a function or...
5
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.