tags:

views:

51

answers:

1

Hi,

Currently I have a DataGrid, and a datasource.

The Datasource is directly pulled from the database in this order:

Id, SalaryId, Old, New

Problem is that it displays the SalaryId, I want it to display the SalaryId Value

How do I do this?

Thanks,

-Kristof

A: 

Pure guess here, but you probably just need to rewrite your original SQL query from something like:

SELECT ID, SALARYID, OLD, NEW FROM tblEMPLOYEE

to something like:

SELECT a.ID, b.SALARYVALUE, a.OLD, a.NEW FROM tblEMPLOYEE a, tblSALARY b
WHERE a.SALARYID = b.ID
MusiGenesis
well that's what I want to avoid, I don't want to do a join.
Snake
Well, your alternatives are: 1) run your original query, then iterate through the rows in your result set, running a separate query against the Salary table to replace SalaryID with Value; or 2) magic. Why don't you want to do a join?
MusiGenesis