Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select pmtblempreg.Id,pmtblempreg.Name,pmtblempreg.UserName,pmtbldesignation.Designation, pmtblempreg.skypeid,pmtblempreg.EmailId from pmtbldesignation
right join pmtblempreg  on pmtbldesignation.Id=pmtblempreg.DesignationId


This query works fine in oracle database.... But when executing using sqlDataSource for populating a gridview an error is showing that invalid table name

when i execute it through the query builder of sqldataSource the query changes to
SQL
SELECT        PMTBLEMPREG.ID, PMTBLEMPREG.NAME, PMTBLEMPREG.USERNAME, PMTBLDESIGNATION.DESIGNATION, PMTBLEMPREG.SKYPEID,
                         PMTBLEMPREG.EMAILID
FROM            { oj PMTBLDESIGNATION RIGHT OUTER JOIN
                         PMTBLEMPREG ON PMTBLDESIGNATION.ID = PMTBLEMPREG.DESIGNATIONID }


an oj is automatically created along with the table name.... Is that the problem??
Posted
Updated 31-Jan-14 19:40pm
v2
Comments
JoCodes 1-Feb-14 1:46am    
Where are you creating oj? Are you trying the query in Markup code of SqlDatasource?
Guru Thilakan 1-Feb-14 1:57am    
Yes i have created the query in markup code of SqldataSource.
JoCodes 1-Feb-14 2:39am    
Whats oj here?

1 solution

Use the Query you have posted first which is working while executing in DB side.
Or remove "oj" and the Curly Braces from the second query and use it.
 
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