Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help writing an If statement

Status
Not open for further replies.

JJ297

Programmer
Jun 27, 2007
30
0
0
US
Hello I'm a newbie to programming and need help writing an if statement. Is this the correct forum?

I have a database set up in SQL with the following fields:

Category Questions Answers

I only want one category to appear for all of the questions and answers submitted for that category. The way I have it set up now all if a question is submitted for the same category then the category will list twice and a one question under each other.

How do I write something if I Dim Category

If it's the same category but a different question just list that question under that category. If it's a new category list that category and the questions and answers under that
 
This isnt an IF question, this is a data display question. Depending on how you are showing the user information you may or may not be able to do this.

By the sounds of what you are trying to do, you are showing the info in a datagrid. This may be easier to "fake" in your stored procedure, or else you have to run "clean-up" on the datagrid view. if you run "clean-up", then you cannot allow the user to sort the datagridview, or it will do bad things to your display.

You may want to look at building a TreeView and showing the information that way.


-The answer to your problem may not be the answer to your question.
 
Thanks I'll try the tree view
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top