Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2007, 06:07 PM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Search in Database?????

Hi , everybody

I have 2 Textbox and 1 Button , and Database containing 3 column (ID,words in English language,words in another language),then
I want code that
When i entered word in English Language in textbox1 then click the button
textbox2 appear on it the word in another langauge
I hope You understand ME .
i Know the idea in this program
the basic thing i use it is "Column ID"
i match between the Word in English Language and the Word in another Language Through "ID"
but i don't know how i write the code?????


 
Old October 10th, 2007, 07:29 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Not sure where you are going wrong. Surely you just query the table:
Code:
SELECT [NonEnglishColumn] WHERE [EnglishColumn] = @Term
As an aside it seems like a poorly designed database schema, what happens if you want to add a language?

--

Joe (Microsoft MVP - XML)
 
Old October 10th, 2007, 07:41 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I agree with Joe, your application will not scale well at all.

Consider your given table with this data:

ID English OtherLanguage
1 Fork Bifurcación <--Spanish
2 Fork Fourchette <--French
3 Fork Gabel <--German
*Translations provided from http://babelfish.altavista.com/

If I am a user of the application and I want the German equivelant how will I tell the program that? My guess is that you do something like this to assign the value to the second textbox:

txt2.Text = dt.Rows[0]["word"].ToString()

or you execute a scalar in which case the spanish version of the word would be the row returned (if you executed Joe's query)

You should probably have an additional field in your datatable something like LanguageID_fk (that would relate to a look up table of all languages) and then a combo box on your application to allow the user to select their desired language.

My 2 cents anyway.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to search in database saif44 ASP.NET 2.0 Professional 11 March 8th, 2006 03:33 PM
need help, to Search from database vikky17 Classic ASP Basics 1 February 5th, 2006 12:35 AM
database search rajuru PHP Databases 2 November 9th, 2004 04:32 PM
Search Database bspradeep Classic ASP Databases 1 September 15th, 2004 05:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.