Hi all,
How do I display multiple database rows in the one textBox?
The textBox is bound to the Database table and should display 3 database values.
However it displays only one.
How do I join table rows??
e.g. My table has 3 rows with same ID and want them all displayed in textBox...
myField ID
----------------- ---------------
itemA 2
itemB 2
itemC 2
thanks.
10 16215
Hi all,
How do I display multiple database rows in the one textBox?
The textBox is bound to the Database table and should display 3 database values.
However it displays only one.
How do I join table rows??
e.g. My table has 3 rows with same ID and want them all displayed in textBox...
myField ID
----------------- ---------------
itemA 2
itemB 2
itemC 2
thanks.
Set the "Multiline" property of the TextBox to true. Then you can display whatever you want.
Or you could use a RichTextBox instead.
Tried "Multiline" but no difference.
The textBox is bound to a dataset but only one row is displayed in it.
Tried "Multiline" but no difference.
The textBox is bound to a dataset but only one row is displayed in it.
Hmmm, never used a TextBox in that way. Have you tried to see how the RichTextBox behaves?
Hmmm, never used a TextBox in that way. Have you tried to see how the RichTextBox behaves?
hi ,
please try to set the textmode is "multiline" for corresponding textbox its working.
Thanks,
http://www.tryangled.com
http://www.tryangled.net
http://iteamweb.com
I am not sure you can use a texbox in that mannor, it's possible, but seems counter-intuitive. You have uniquely seperated lines that you just want to jumble into a big textbox
If you just wish to display the data, a ListBox might be a better fit.
Or you could make a middleman function in between what your database returns and what your textbox gets bound to. That function would read in all the data from the database and mush it into the textbox.
Tried "Multiline" but no difference.
The textBox is bound to a dataset but only one row is displayed in it.
Is the problem that the data from the database is being displayed:
"itemA 2 itemB 2 itemC 2"
Or is it that you're only displaying:
"itemA 2"
You may have to put "new lines" in after each row retrieved from the database?
How are you filling the textbox?
Is the problem that the data from the database is being displayed:
"itemA 2 itemB 2 itemC 2"
Or is it that you're only displaying:
"itemA 2"
You may have to put "new lines" in after each row retrieved from the database?
How are you filling the textbox?
it's only displaying "itemA"
I want it to display itemA,itemB,itemC
Do I have to use a loop for this??
TextBox is bound to a dataset.
Using Visual Studio 2005. DataBindings Text Property set as... fundsAffectedEditBindingSource - myFunds
Suggestion:
Instead you could do the concatenation in db itself as follows
declare @abbr varchar(1000)
select @abbr=COALESCE(@abbr+ ',', '')+Col1 from Table where ID=@ID
select @abbr
it's only displaying "itemA"
I want it to display itemA,itemB,itemC
Do I have to use a loop for this??
TextBox is bound to a dataset.
Using Visual Studio 2005. DataBindings Text Property set as... fundsAffectedEditBindingSource - myFunds
it's only displaying "itemA"
I want it to display itemA,itemB,itemC
Do I have to use a loop for this??
TextBox is bound to a dataset.
Using Visual Studio 2005. DataBindings Text Property set as... fundsAffectedEditBindingSource - myFunds
Check out this .NET article on how to use a database in your program. Try using the examples in your program...especially look at the section on "Executing Your SQL Commands". The only change you'll have to make is to add a loop that looks like: -
While myDataReader.Read
-
TextBox1.Text = TextBox1.Text + " " + CType( dr.Item("FieldName"), String)
-
End While
-
Hope this helps you!
-Frinny
Select list box instead of text box and choose property called row sources and choose what ever table field you like it will allow you to display multiple values from same field
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tom |
last post by:
Hi
I want to display the DB data in a tabcontrol. There is a textbox insides that tabcontrol
<code
private void Bind_DBData(
string strSql = "select * from table WHERE id > 0 order by id"...
|
by: Alpha |
last post by:
Hi,
I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a
listbox that I have binded to a dataset table, "source" which has 3 columns.
I would like to display 2 of those...
|
by: Joe Van Meer |
last post by:
Hi,
Is the datalist meant for one table or can I use it to display information
from 2 different tables? Or should I be looking at a datagrid instead?
I began my code and kinda ran into a snag...
|
by: michael |
last post by:
Hi all,
i want to know how to display multiple lines in one crystal report chart in
asp.net
i wrote some codes but it always display 2 lines in separate chart(please
refer to the codes...
|
by: .Net Newbie |
last post by:
Hello,
I am currently coding my ASP.Net pages in c# and have run into a question
concerning Emails. I have four objects on a page (six including 2 buttons).
The first is a subject line...
|
by: assgar |
last post by:
Hi
Developemnt on win2003 server. Final server will be linux
Apache,Mysql and PHP is being used.
I use 2 scripts(form and process).
The form displays multiple dynamic rows with chechboxs,...
|
by: gyap88 |
last post by:
My search engine in visual basic 2005 has 4 textbox for users to input values, named textbox1,textbox2,textbox3,textbox4.
I have a string assigned to each of the textbox named...
|
by: kurtzky |
last post by:
i created a form that should function as follows:
i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a...
|
by: stoogots2 |
last post by:
I have written a windows application that performs several functions (is multi threaded). I have a Textbox in the main window of the app which I want to display the contents of the logfile and...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |