Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one table named as 'TransactionMaster'

Suppose in a cd/Dvd shop one customer take cd/Dvd multiple times..He didnt return back..

That time the details will save like different transaction ids and same name and different cd names in Transactionmaster..
the table will looks like this

TransactionId CustomerName MovieName
1 Name1 Movie1

2 Name1 Movie2

3 Name1 Movie3



But i want to display this in one row in a gridview like

CustomerName in one label and movieName in one dropdown..Dont repeat

pls help..
Posted
Comments
Zubair Alie 10-Oct-12 8:53am    
what is the purpose of DataGridView here?
you may have dataTable returned. you simply place a label & assign it a row[0]["CustomerName"] and datasource this table to dropdownlist where displayMember of dropdownlist will be ["MovieName"].

is it clear..?
kanamala subin 10-Oct-12 9:35am    
its an example different customer names will come down

1 solution

Just use DISTINCT in your query when you pull the data from the database.
SQL
SELECT DISTINCT Name1, Movie FROM ...
 
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