473,516 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connect a DS to a textbox in ASP.net

Hi,
I've got a listbox linked to a DataSet in this way:
// connetto la lista di clienti ai dati
this.lbClienti.DataSource =
GestoreClientiDistributori.caricaElencoClienti().T ables[0];
// imposto DENIMINAZIONEBREVE come valore visualizzato
this.lbClienti.DataTextField = "DENOMINAZIONEBREVE";
// imposto CODICE come valore nascosto
this.lbClienti.DataValueField = "CODICE";
// eseguo il binding dei dati
this.lbClienti.DataBind();
the first instrution assign the datasource as a dataset.

Now when I select a value from the listbox I would like to
connect someother controls (textbox) to the other
information associated with that list element.

Is it possible?
Thanks,
Andrea
Nov 15 '05 #1
3 1225
It is, just set your listbox to AutoPostBack

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #2
I've got the list element, but I would like to retrieve
the other values from the ds without interrogating again.
Is it possible?
-----Original Message-----
Hi,
I've got a listbox linked to a DataSet in this way:
// connetto la lista di clienti ai dati
this.lbClienti.DataSource =
GestoreClientiDistributori.caricaElencoClienti(). Tables [0];// imposto DENIMINAZIONEBREVE come valore visualizzato
this.lbClienti.DataTextField = "DENOMINAZIONEBREVE";
// imposto CODICE come valore nascosto
this.lbClienti.DataValueField = "CODICE";
// eseguo il binding dei dati
this.lbClienti.DataBind();
the first instrution assign the datasource as a dataset.

Now when I select a value from the listbox I would like toconnect someother controls (textbox) to the other
information associated with that list element.

Is it possible?
Thanks,
Andrea
.

Nov 15 '05 #3
On Mon, 22 Sep 2003 05:17:09 -0700, Andrea Lodrigo
<an************@tiscali.it> wrote:
I've got the list element, but I would like to retrieve the other values
from the ds without interrogating again.
Is it possible?


I'm not sure if I understand. If you use autopostback and capture
SelectedIndexChanged in your source file, you can look up whatever
information is associated with that list item and put it in the text box.

Use a dataset and store it in a [SESSION] variable to prevent unecessary
database connections.

However, if you want something like Nvidia's driver selection listboxes
without posting the page back, you will have to write it in javascript.

I'm afraid your code isn't very informative. A word of advice, if you
write your code in English at all times it will be easier to get help, both
by giving examples of your code and searching for similar code phrases.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1921
by: Don | last post by:
Hello, I am having some troubles and was hoping for some help. I have created links to DB2 tables using DB2 Connect I have multiple queries that I run each day and I need to provide them with a date to use in the query. I am trying to set up a textbox on my main form that I will enter the date into and then use that in the queries.
9
9515
by: Zeeshan Iqbal via AccessMonster.com | last post by:
hi, im trying to design a form with two subforms. subforms no.1 (orders) is connected to the main form by customer ID and i dont know how i can connect another subform (order details)to the first subform(orders), so that when i enter a customer id i get the orders related to that customer in subform no.1 and order details related to that order in...
7
3620
by: | last post by:
I am having trouble figuring out to call a database INSERT procedure from a simple submit form. It appears I should use the onclick event to trigger the procedure called BUT when I do this I receive this error: 'btnInsert_Click' is not a member of 'ASP.Insert_aspx'. I realise the procedure is houwsed in a sub which may be what is...
2
1861
by: iwdu15 | last post by:
hey, i was wondering if 1) anyone could tell me whats wrong with my code, i did a little fixing to the msdn version fo this, or 2) how to make a simple program that will connect and listen for connections async. if the user pushes the selected buttons. i just want a program that connects to another computer on the port and IP address selected...
2
1113
by: honeygracee | last post by:
hi i am doing a program and i need to connect 5 projects in 1 solution but right now i am only doing the first project to be connected to the oracle connnection. can you help me on how can i view the first name, middle name and last time on my textbox if i search the employee number ? below is my code sample.. please help me.. Try...
1
915
by: Jolace | last post by:
i have project with 5 forms and each form have button "pecati" .. When i press here i like to save numbers and name from combobox,textbox and labels... how i can do that? how i can connect because mu project is finished...
2
4453
by: BOS | last post by:
Hi there, I just create a form that contains name, Address, City, State, Zip, Question Checked box, and dropdown list selection for the user to fill-out the answer in the texbox, checkbox or choose the selection the option... For example here is the Form properties I setup: Text="Name" Text ID="LabelName" TextBox="TextBoxName"...
9
2560
by: Peter Lux | last post by:
I'm fairly new to c#, but not new to programming. I'm tasked with rewriting our Gupta/Sqlwindows apps (5 years worth of development) in dot Net. The main reason is that virtually no one knows the language, which is unfortunate because it's very simple to get windows created and rolled out. I downloaded C# (orcas) express and had created a...
1
1461
by: ragtopcaddy via AccessMonster.com | last post by:
I have a fairly static odbc connect string that should be visible in a text box on a form for reference purposes. It seems excessive to me to keep a table with 1 field and 1 record to record this string. Is it advisable to use a tag instead? I'm thinking of keeping the string in the textbox's tag, and providing a cmd button to change the value...
1
7142
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...
0
7548
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
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
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.