Click here to Skip to main content
15,884,927 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
If one input is being mapped to more than one outputs in database ,then how to display all the outputs in c# ? I am working on punjabi to english transliteration. For e.g. "ਵੀਰ" a word in punjabi can be written as "veer" and "vir", and both "veer" and "vir" are stored in database ,then how to have both the outputs of "veer" and "vir" on input of "ਵੀਰ".

What I have tried:

I am tried with multiple queries but its not a feasible solution.
Posted
Updated 18-Apr-17 3:44am
Comments
OriginalGriff 13-Apr-17 2:31am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
We only get exactly what you type to work from - we get no other context. So show us what you tried, what it returned, and explain why it didn't do what you wanted.
Use the "Improve question" widget to edit your question and provide better information.
kumar nitesh 13-Apr-17 2:55am    
Please provide details of your db schema and requirements .
You can select multiple row from select statement depending on a where clause and store it in a list/dataset . But i don't understand this is very straight forward then what is the problem you are facing ,please mention everything clearly .
ZurdoDev 13-Apr-17 7:19am    
This does not make any sense. What are you asking?

1 solution

You need to have a table for the words you are going to translate - for example:
SQL
create table basewords
(
	id int identity(1,1),
	word nvarchar(125)
)
insert into basewords values ('ਵੀਰ')
Then a table for the translation words that links back to that base table can have many entries per "base" word. For example:
SQL
create table translated
(
	id int identity(1,1),
	word nvarchar(125),
	transOf int	-- Foreign key back to basewords
)

insert into translated values
('veer',1),
('vir',1)
Then you can get the matching words back with this simple query:
SQL
select B.word, T.word as translation
from basewords B
left outer join translated T on B.id=T.transOf
Which would give results
word translation
ਵੀਰ  veer
ਵੀਰ  vir
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900