Click here to Skip to main content
15,905,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to display names in gridview instead id's present in table...
Posted

Question is Not clear!

If your sql query looks like:
SQL
SELECT ID
FROM Table1

only ID will be visible in a gridview, but if you write sql query like this:
SQL
SELECT *
FROM Table1

all fields will be visible in a gridview.

If your query returns many fields (columns), you need to hide column with ID field - as Prasad_Kulkarni wrote.
 
Share this answer
 
Looks like you are talking about foreign key in one table and you want FieldName from other table i.e. Customer table is having AccountID field and you want to show AccountName in grid View.

Try :
SQL
Select a.CustomerName, a.CustomerAddress, b.AccountName
from tblCustomer a
inner join
tblAccounts b
on a.AccountID=b.AccountID
 
Share this answer
 
 
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