The schema returned by the new query differs from the base query error  
Author Message
Downforce





PostPosted: .NET Framework Data Access and Storage, The schema returned by the new query differs from the base query error Top

Hi guys m working with vs2005 and SQL2005,

When i try to add a query to my table adapter its saying: The schema returned by the new query differs from the base query

And m building the query in the query builder and it says its correct , but when i want to add the query m getting the error here's the query:

SELECT Bestellingen.Totaalprijs, BestellingInhoud.Aantal, BestellingInhoud.Prijs_per_stuk,
BestellingInhoud.Aantal * BestellingInhoud.Prijs_per_stuk AS Expr1
FROM Bestellingen INNER JOIN
BestellingInhoud ON Bestellingen.BestellingID = BestellingInhoud.BestellingID

I hope somebody has any solution m getting sick of that error



.NET Development7  
 
 
Damiaan





PostPosted: .NET Framework Data Access and Storage, The schema returned by the new query differs from the base query error Top

Hi

The reason is that the field don't match with the original fields.
Every "select" statement should have the same output fields.

So you will not be able to use this query to fill a datagrid etc., But you will be able to use the query within your code.

To solve this problem, make a new datatable by dropping the query onto the dataset. Or put the query in a "stand alone" tableadapter (also called a QueriesAdaptor)

hope this helps.
Kind regards (Met vriendelijke groeten)