473,394 Members | 1,956 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,394 software developers and data experts.

match up textbox value to database tabel

109 100+
Hi all,

I need some suggetion.
Expand|Select|Wrap|Line Numbers
  1. I have two different database. 
  2. 1) Has information about all M series unit like m1,m2 etc
  3.  
  4. 2) second one has information about all B series unit like b1,bls1,bls12 etc.
  5. here, I have table called Unit which store all b series unit.
  6.  
  7. and I have .net form with a textbox. user can add a unit number like m1,b12 ect.
  8.  
click on "Submit" button, how can I check which unit has been entered specially with unit stores in database table called "Unit" and then direct my database connection to appropriate database.

Please help and give me some suggetion on how can do that.

I have database connection set up and all but don't know how to make a textbox value with a database table to find a valid match and open a appropriate connection.

Thank You,
Apr 23 '08 #1
5 1883
balame2004
142 100+
Hi all,

I need some suggetion.
Expand|Select|Wrap|Line Numbers
  1. I have two different database. 
  2. 1) Has information about all M series unit like m1,m2 etc
  3.  
  4. 2) second one has information about all B series unit like b1,bls1,bls12 etc.
  5. here, I have table called Unit which store all b series unit.
  6.  
  7. and I have .net form with a textbox. user can add a unit number like m1,b12 ect.
  8.  
click on "Submit" button, how can I check which unit has been entered specially with unit stores in database table called "Unit" and then direct my database connection to appropriate database.

Please help and give me some suggetion on how can do that.

I have database connection set up and all but don't know how to make a textbox value with a database table to find a valid match and open a appropriate connection.

Thank You,
You are complicating the task what you want to do.

You can simplify the task by normalizing your database tables.

My idea is coming below:

1.Create the following two tables in database
UnitTypes(UnitTypeId,Name) -
Sample data : 1,B series
2,M series

Units(UnitId,UnitName,UnitTypeId)
Sample data : 1,b1,1
2,b2,1
3,m1,2
4,m2,2

You can relate UnitTypeId of Units with UnitTypeId of UnitTypes table.


2.Front desing as follows.
1. Combo Box to show Unit Types - Populate UnitTypes from UntitTypes table.
DisplayMember ="Name"
ValueMemebr = "UnitTypeId"

2. Text Box to enter unit.

3.Run the below logic in submit_click event once user entered new unit (eg : b1) and clicked submit button.
- Store the unitname and untiTypeId(Combobox.selectedvalue) in Units table.

I Hope it will help you.

Let me know if you have doubts.

- Balaji U
Apr 24 '08 #2
arial
109 100+
Thank You Balaji U,

I can't use combo box as, my list is really big and it will grow over the time.
So, I like user to typed in their unit and bring up the records for that perticular unit.

Please suggest something without combo box.

Thank You,
Apr 24 '08 #3
deric
92
So, are you going to follow Balaji's suggestion? With his suggested database structure, you can add more unit type (series) without creating another table for it.

I'm confused with what you stated.
1. Do you have two different database or just two different tables in one database?
2. Is the user going to input only one unit number at a time? Or can he input a comma-separated unit numbers?
Apr 25 '08 #4
balame2004
142 100+
So, are you going to follow Balaji's suggestion? With his suggested database structure, you can add more unit type (series) without creating another table for it.

I'm confused with what you stated.
1. Do you have two different database or just two different tables in one database?
2. Is the user going to input only one unit number at a time? Or can he input a comma-separated unit numbers?
Hey Arial,


Your idea does not sound good and it consumes more space since you are trying to maintain different database/tables for each type of units.

How can you identify the unit type. Unit name itself?. If so it does not sound good.

Unit types 'B Series', ' M Series', 'T Series' should be inserted into UnitTypes table and combo box should be populated with unit types from UnitTypes table.

You should allow user to enter unit name (eg : b1) and select unit type(eg: B Series) from combox box. So you can easily identify and process the unit type which is entered by the user.



- Balaji U
Apr 25 '08 #5
arial
109 100+
Actually its a two different system, unit with M series and B series.

Database is already designed and in place on different server.

I am doing a front end app. to pull up the data using a common application.

So, that why I need to make a value of textbox to match with atleast one unit table. meaning I think I have to search a whole unit table to see if there is a match. If it is not in that table then it is in other table and open that database connection to pull rest of the other recrods.

Thank You,



I
Apr 25 '08 #6

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

Similar topics

2
by: GreggTB | last post by:
Hello, I'm trying to perform a very simple validation of user input. I want to verify that the user entered a six-digit string consisting entirely of numbers. So anything from 000000 to 999999 is...
1
by: A | last post by:
Hi I have a tabel as follows Matrix Tabel Row
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
7
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL...
11
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and...
2
by: jason | last post by:
hello. i am just trying to save a TextBox.Text value to a database, but strangely, when the value is changed on the web form, the changes are not recognized in the event where i try to save the...
1
by: Mario1776 | last post by:
I have several textboxes programmatically bound to several database fields. For some reason, when I move from one particular textbox (lets say "FieldG") to another control on the form the original...
3
by: fabdulla | last post by:
I have a tabel A in access database A and i would like to copy tabel A into access database B. But when ever tabel A updates I want tabel B to update as well. If anyone know who to do this please...
7
by: Kristiansj | last post by:
Hey, I am a fairly novice coder and I am having some trouble making an elegant solution to the following problem: (pseudocode) ------------ switch (something) { case (something1) tabel =...
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?
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
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
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...
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...

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.