473,320 Members | 2,035 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,320 software developers and data experts.

How do I get data from Database Table selection into other TextBoxes?

4
I am having some trouble w/ a school project database that I am doing. The
database is used for a ski rental shop. In the rental table I have various
customers w/ rentals on different days. I have a combobox that selects the
customer number from my customer table. What I would like it to do is
propigate the data into text boxes, then have another combo box where I can
select the date of the rental so that I can display the rental information
for the invoice. I am not sure how to get this to work properly as I am
still on a steep curve w/ database interfacing. Any help would be great!
Thanks in advance!

Brad B.
brad_britton atdisdsa hotmail.com
Nov 15 '05 #1
1 1884
Bob
One thing you might want to try is DataBinding. You should be able bind your SQL data table to the ComboBox. I believe you can either do this directly to the sql dataset you pulled or into a datatable that is derived from your sql dataset. In the combo box you can set the display colum and and a value to key of. Then in the selection change event you access the data table and populate each field on the screen... ie:

txtName.Text = mydatatable.rows[box.selectedindex]["name"].Tostring();

Where "name" is the column name. You could also look at binding to data grids. A good place to read on this would be under the DataTable/DataRows/DataBinding areas. There are many different ways to do this. I am sure some others will chime in as well. Think of your data table as if it was a sql record set.
Nov 15 '05 #2

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

Similar topics

4
by: Justin Lebar | last post by:
Sorry about the huge post, but I think this is the amount of information necessary for someone to help me with a good answer. I'm writing a statistical analysis program in ASP.net and MSSQL7 that...
2
by: Jesse | last post by:
Hi there, I am trying to bind a combobox and some textboxes to a single table in a dataset. I want it so that when a (unique) value in the combobox is selected, the other textboxes show...
5
by: Jon | last post by:
I have a database that mysteriously takes information from fields in one clients record and places it into the fields of another client record. This happens sporadically. I end up finding data all...
5
by: Jonny | last post by:
Hello, I have created a button on my form which when pressed does the following : 1) Run a pre-defined Macro, which is picking up a query and running my data to excel. However, I need the...
2
by: Jeremy Dillinger | last post by:
I have a program setup to pull data from a database. My database table has things such as (category, Item, price, etc.) In my program I want to have multiple list boxes that will have a pull down...
5
by: Aspnot | last post by:
Background: I have a data entry form that is bound to a DataSet. This DataSet contains 9 tables and the form displays data from each table in textboxes, not a DataGrid. One of the tables in the...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
3
by: Max | last post by:
Hello, I made a windows form with a combo box and 4 text boxes. All 5 objects should get their data from a data set which is populated in the form load method. The combo box has item ids. When...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.