Click here to Skip to main content
15,885,952 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need search bottom value in the table to combo box or text box
im use this code. earlier project i do it.but this time i cant do this

um used this query

SELECT Name
FROM Diesal1
ORDER BY date DESC

it was executed correctly

then apply it to text box. after that i got this error

"The schema returned by the new query differs from the base query"
What is the wrong with this. pls help me......
im using vb.net 2008 and SQL Express

thank u...........
Posted
Comments
_Damian S_ 6-Nov-13 22:44pm    
If your query is returning the correct data, then all you need to do is stash the returned value in the text box. There seems to be some information missing...
GuyThiebaut 8-Nov-13 12:00pm    
Try something like:

select top 1 name
from diesal1
order by date desc
Mike Meinz 9-Nov-13 8:59am    
It is very difficult to guess what you are doing to cause this error when you do not provide your VB .NET code. My guess is that you are using a TableAdapter and the columns in the TableAdapter do not match the columns in the SELECT statement that you showed in your question. Try changing the SELECT statement from
SELECT Name FROM Diesal1 ORDER BY date DESC

to

SELECT * FROM Diesal1 ORDER BY date DESC

or

SELECT TOP 1 * FROM Diesal1 ORDER BY date DESC

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