User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,249 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,096 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 7754 | Replies: 23 | Solved
Join Date: Mar 2008
Posts: 14
Reputation: Ramon78 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Ramon78 Ramon78 is offline Offline
Newbie Poster

SQL Data into Textbox or Listbox

  #1  
Mar 26th, 2008
Hi all,

In my C# application I have a SQL database with a table called Customers. In this table I have several columns like Name, Street, ZipCode and City.

I already managed to get data in and out the database with the use of datasets, tableadaptors and bindingsources and get them into textboxes and listboxes. So far no problem.

But…. the thing I want is to run a SQL query like below and get all the results in a single textbox or listbox. The important things is, that every entry in the textbox or listbox should be on a new line. Multi line for example.

So the result in the textbox should look like:

Ramon
Streetname
NewYork
1111AA

This is the statement I want to run where @1 is a variable.

SELECT Name, Street, ZipCode, City
FROM Customers
WHERE (CustomerID = @1)


I hope someone can point me to the right direction.

Cheers,
Ramon.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 8:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC