473,770 Members | 4,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create textbox like array with database

Kosal
68 New Member
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 1836
cloud255
427 Recognized Expert Contributor
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 New Member
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 Recognized Expert Contributor
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.Locati on.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
2382
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 loop and create the textboxes with ID and text value and then add to the form. The problem is when trying to create the control in the code behind page I get the error "Multiple controls with the same ID 'txtQLLink1' were found". How do I retrieve...
0
3645
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 datagrid on the left side that lists names and perhaps a couple of other key fields. The user can click on a record in the datagrid, which should automatically pull up details on that record in the various text boxes and other controls on the right...
0
411
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 from that textbox to next window in asp .net
4
1697
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, txt3} Then I loop through that array Private Sub onEntering(ByVal sender As Object, ...) Handles _
1
1468
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 = ScrollBars::Vertical; I read my database with a description for the user. I want to load each line into a listView. With wordWrap and the Width of the textBox gives
0
827
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 and is unformatted. I display the text to my user in the listview. The textbox I create logically in the program, and I initialize the correct properties for a normal multiline editor.
6
2118
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 Social Security Number: = 111223333, 444556666, 777889999
0
2400
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 View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
2
5882
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 place...can anyone help me?? i didnt made anything in the VALUES (unless the POST ), because i bet the error is there (yes, the arrays are missing): $sql = "INSERT INTO dgplanets ( ID, coords , player name , alliance , name , ground , orbit ,...
0
9591
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10001
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.