Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Handle SQL errors with severity 10

Handle SQL errors with severity 10

Scheduled Pinned Locked Moved Database
csharpcssdatabasetutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _J_
    wrote on last edited by
    #1

    :confused:how to handle sql errors with severity less then 10 in C# .... From russia with love ....

    C 1 Reply Last reply
    0
    • _ _J_

      :confused:how to handle sql errors with severity less then 10 in C# .... From russia with love ....

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      Here's a link[^] that might help. Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

      _ 1 Reply Last reply
      0
      • C Chris Meech

        Here's a link[^] that might help. Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

        _ Offline
        _ Offline
        _J_
        wrote on last edited by
        #3

        thanks my canadian bra, i will follow the link .... From russia with love ....

        C 1 Reply Last reply
        0
        • _ _J_

          thanks my canadian bra, i will follow the link .... From russia with love ....

          C Offline
          C Offline
          Chris Meech
          wrote on last edited by
          #4

          frmRussia wrote: thanks my canadian bra, I'll assume that should be 'bro' and say 'Glad I could help'. :) Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

          _ 1 Reply Last reply
          0
          • C Chris Meech

            frmRussia wrote: thanks my canadian bra, I'll assume that should be 'bro' and say 'Glad I could help'. :) Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

            _ Offline
            _ Offline
            _J_
            wrote on last edited by
            #5

            ok bro. my sql server knowledge is like c# knowdlege --> like english , understand :laugh:. I wrote the link u advise me, but don't really know how to use it my app, if i write in the catch block: catch(System.Data.SqlClient.SqlError err) {....} i got compilation error, "The type caught or thrown must be derived from System.Exception" .... From russia with love ....

            C 1 Reply Last reply
            0
            • _ _J_

              ok bro. my sql server knowledge is like c# knowdlege --> like english , understand :laugh:. I wrote the link u advise me, but don't really know how to use it my app, if i write in the catch block: catch(System.Data.SqlClient.SqlError err) {....} i got compilation error, "The type caught or thrown must be derived from System.Exception" .... From russia with love ....

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              I think that would be

              catch(SqlException se)
              {
              }

              If there is only one error then the exception object will contain the details. If there is more than one error the exception object will contatin the details of only the first error. You then have to look in the errors collection for the other errors.

              catch(SqlException se)
              {
              foreach(SqlError error in se.Errors)
              {
              // Do something with each error
              }
              }

              Does this help?


              My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

              _ 1 Reply Last reply
              0
              • C Colin Angus Mackay

                I think that would be

                catch(SqlException se)
                {
                }

                If there is only one error then the exception object will contain the details. If there is more than one error the exception object will contatin the details of only the first error. You then have to look in the errors collection for the other errors.

                catch(SqlException se)
                {
                foreach(SqlError error in se.Errors)
                {
                // Do something with each error
                }
                }

                Does this help?


                My: Blog | Photos WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

                _ Offline
                _ Offline
                _J_
                wrote on last edited by
                #7

                i tried it however i never got to catch block with error that severity <=10 .... From russia with love ....

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups