473,396 Members | 1,997 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.

How to create textbox like array with database

Kosal
68
Dear Sir/Madam

I would like you to help to give me the example about create textbox like array but I want to create textbox depend on record in database if have 2 record textbox have 2 and display data in textbox also.

so please help to advice

thanks

Best Regard
Kosal
Sep 8 '08 #1
3 1804
cloud255
427 Expert 256MB
Ok,so what i gather is that you have a table in your DB, you want to read all the records of that table and then create a text box for each record and display some data relevant to that record in its text box?

if this is the case, you should just loop through all the records and create a new textbox for each record, i would use a collection to store the textboxes:

Expand|Select|Wrap|Line Numbers
  1. Collection<TextBox> txtCollection = new Collection<TextBox>();
you then need to create a new textbox object for the record, note that you should specify things like the location and text when creating the text box. I assume the text property will have a value from the record.

You then add the textbox to the collection and there you go.

Good luck
Sep 9 '08 #2
Kosal
68
Yes I want to do like this
but I still cannot do it can you give me for loop record in database and textbox
becuase I know a litle about vb.net so please advice

thanks
Best Regard
Sep 10 '08 #3
PRR
750 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. TextBox[] tx = new TextBox[2];
  2.         Literal lt;
  3.  
  4.         for (int i = 0; i < 2; i++)
  5.         {
  6.             tx[i] = new TextBox();
  7.             tx[i].Height = 50;
  8.             tx[i].Width = 50;
  9.             lt = new Literal();
  10.             lt.Text = "<br/>";
  11.  
  12.             Panel1.Controls.Add(tx[i]);
  13.  
  14.             Panel1.Controls.Add(lt);
  15.             lt = new Literal();
  16.             lt.Text = "<br/>";
  17.             Panel1.Controls.Add(lt);
  18.         }
  19.  
try using this .... for this u need a panel on your .aspx page .. incase you are using windows application then you can also specify location like
textBox1.Location.X and Y.... give you more control....
Sep 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Varad | last post by:
Hi all Pls give me some insight as to what I should be doing. I have a form where I have 20 text boxes and when an user submits the form I save it to a database. When they want to retrieve it, I...
0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
0
by: Raju | last post by:
Hi all i am Rajendran I am working as a asp.net programmer. I am frish to this field so please any of u garify my doubt I Create array of Textbox Dynamically and not passible to retrieve data...
4
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
1
by: Developer | last post by:
VC++ 2005 Express Edition: I have a textBox with the properties: this->m_TextBox_Desc->Multiline = true; this->m_TextBox_Desc->WordWrap = true; this->m_TextBox_Desc->ScrollBars =...
0
by: Eric | last post by:
Visual C++ 2005 Express MVP's and experience programmer's only please!... I need to get the number of lines in a textbox so I can insert them into a listview. The text comes from my database...
6
by: Drum2001 | last post by:
I have a database where I need to query multiple items. Is it possible to run a query based on a textbox where the information is delimited by a comma. Example: Show me all names where...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
2
by: blitzztriger | last post by:
Hello!! how do i insert values into mysql , after parsing a submiting textbox?? I made the arrays, so this should be a basic insertion of them in the db, but something is missing, or in the wrong...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
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
tracyyun
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...
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.