Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 08, 2013 03:35 PM by stockcer
Feb 08, 2013 04:44 AM|LINK
My sql select statement retrieves all rows apart from the first row. What could be the cause of this? and how to get around it. Thanx.
Feb 08, 2013 04:49 AM|LINK
Can you please provide your statement so i can help..................
Feb 08, 2013 05:19 AM|LINK
Check the criteria please.
Feb 08, 2013 06:17 AM|LINK
Please check your sql query, is there any condition based it will retrieve the records.
Feb 08, 2013 06:28 AM|LINK
cmd.CommandText = "SELECT [bookid] FROM [passangers] WHERE (([carrier] = @carrier) AND ([origin] = @origin) AND ([destination] = @destination) AND ([departdate] = @departdate) AND ([arrivaldate] = @arrivaldate))";
bookid is an auto increment field in my sql database table.
I also added the parameters respectively.
Feb 08, 2013 08:43 AM|LINK
Maybe one column of it is having null values. Check this please
Feb 08, 2013 11:07 AM|LINK
If any column have NULL value use ISNULL sql function to get that record
Feb 08, 2013 03:05 PM|LINK
Try to run your query in SSMS first. Check your code to see whether you have read past the first row alread in your code.
Feb 08, 2013 03:35 PM|LINK
A couple of ideas....
1. When you run this directly against sql (without using visual studio) do you get the same returned data as when you run it within visual studio.
2. Look at SQL profiler and see what is actually being run against the server.