473,385 Members | 1,275 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,385 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 1803
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.