Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a DataGridView and I add my query to this, when executed my query throws this error:
The schema returned by the new query differs from the base query

and this my query:
SQL
SELECT     B.SettingKey, 'SysSettingsDep' AS TableName, B.SettingValue, B.SettingDesc
FROM         SysCustomer AS A INNER JOIN
                      SysSettingsDep AS B ON A.SettingKey = B.SettingKey
UNION
SELECT     C.SettingKey, 'SysSettingsMachine' AS TableName, C.SettingValue, C.SettingDesc
FROM         SysCustomer AS A INNER JOIN
                      SysSettingsMachine AS C ON A.SettingKey = C.SettingKey
UNION
SELECT     D.SettingKey, 'SysSettings' AS TableName, D.SettingValue, D.SettingDesc
FROM         SysCustomer AS A INNER JOIN
                      SysSettings AS D ON A.SettingKey = D.SettingKey

help me to solve this,
tnx
Posted
Updated 13-Oct-12 0:21am
v3

Hi,

I found so many threads on the similar issue, have you checked that ?

this[^] seems very useful for you.

check the first answer in above discussion.

Thanks.
 
Share this answer
 
try to use select * instead select column1,column2 of specific columns.
 
Share this answer
 
Comments
amirmohamad 14-Oct-12 5:15am    
how can i try this?

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