Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
hi there
 
in vb.net 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
Comments
Savalia Manoj M at 26-Sep-12 23:16pm
   
Have you Add Try Catch Block? If Not then add and check.

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 585
1 mhegazy94 460
2 Ravi Bhavnani 230
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,295
1 OriginalGriff 6,841
2 CPallini 5,420
3 George Jonsson 3,654
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web04 | 2.8.140922.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2014
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