I have two tables tblCarrier and tblCustomer
. Both tables are INNER JOIN
and have the same column name which is company name. The problem is when I use the databinding process
<%#DataBinder.Eval(Container.DataItem, "CompanyName")%>
to get the back the customer company name, it gives me back the carrier company name. What I notice from my query is that it gets back the company name based on the order sequence in the query statement.
For example
"SELECT tblCarrier.CarrierID,tblLoadMaster.Salesperson,tblLoadMaster.Status, tblCarrier.CompanyName, tblCustomer.CompanyName"
This T-SQL statement will bring back the carrier company name, but if I were to put the tblCustomer.CompanyName
before tblCarrier.CompanyName
, it will then bring back the customer company.
Is there way to databind the columns to get the results based on the cross reference table?