Click here to Skip to main content
13,044,584 members (64,179 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hi there

in when i make mistakes in query then it's not giving error.

so how can i know what is the mistake in my query.
Posted 26-Sep-12 16:57pm
Savalia Manoj M 26-Sep-12 23:16pm
Have you Add Try Catch Block? If Not then add and check.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The simple answer here is that an error isn't being thrown or you are ignoring it. Don't forget that VB.NET isn't validating your SQL code (for the most part). Instead, SQL Server is doing that. Therefore, you won't get the same error events as you would in your code. Depending on how you are connecting to your SQL server, you can usually query the command object (I believe that is the one) to get error information.

Don't forget too that a SQL statement that returns the wrong information isn't an error. Otherwise it might be working and just not doing what you want it to do.

My suggestion is to run all queries in SQL and then copy them into VB.NET. Also, use Stored Procedures so you can make simple calls to the server.
Meysam Tolouee 27-Sep-12 3:58am
Good explanation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100