Querying a single column and displaying all results in a single textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Randyds
    New Member
    • Sep 2010
    • 3

    #1

    Querying a single column and displaying all results in a single textbox

    I am trying to make a list, separated by a comma, of entries from a single column in a SQL database. I have been spending the last several days searching for a way to do this, but every thing I found either didn't work, or wasn't exactly what I was looking for.

    The query will pull all the email address that are not null. I already know how to do the query, so I do not need help with that. What I need to know is how to take the result of that query and make it look like this:

    email0@address. com, email1@address. com, email2@address. com, etc, etc, ...

    I feel like I should know this, but for the life of me, I can't remember nor can I find it in any of the textbooks I have.

    I am using Visual Basic 2010 and SQL Server 2005. I also have access to Visual Basic 2005 if needed.

    Any help would be appreciated. Thank you.
  • Randyds
    New Member
    • Sep 2010
    • 3

    #2
    A quick update. I think I have found what I am looking for. However, I am having issues with the code. Here is the code that I am using:


    The part that I am troubles with is:
    1. What do I use for the server name, and where do I find it? Like I said above, I am using SQL Server 2005.

    2. What about logging in if I use Windows Authentication?

    Comment

    • Randyds
      New Member
      • Sep 2010
      • 3

      #3
      Alright, this is kind of turning into a self help thread, sorry about that. I have figured out the previous questions. Now I have some new issues.

      I am using a MDI Parent form to call multiple windows. One form is to display the query from above. The second form displays the data in either a datagrid, or detail view. However, when I open the second form, close it, then open the first form and run the query, I get an error saying that I cannot login to the server. And when I open the first form and run the query, close it, then open the second form, none of my data appears. How do I fix this?

      Comment

      Working...