1 Reply Latest reply: Mar 13, 2013 11:36 AM by Tridus RSS

    Create a library for all stored procedures

    936666
      Hi,

      how to create or write a method or class library in .net to connect the database. i.e i need to connect the database using a common method, inside this method there will be some stored procedure.

      Say inorder to login

      1 ) exec Proc_login(userid,pass) this is the SP name i need to create a method for this say method name login

      2 ) exec Proc_getinfo(empid) this is the SP name i need to create a method for this say method name getinfo

      3 ) exec Proc_UpdateAddressinfo(empid,Address) this is the SP name i need to create a method for this say method name addupdate

      4 ) exec Proc_logout(userid) this is the SP name i need to create a method for this say method name logout

      Can we create a common method or a class type to access this details.

      Using this newly created class or method other team members will use this class or method as reference.

      This method or class will be called by C# , Vc++ , java code so the library is created in C#.It is ment as a common library path.

      Is there any links are there for the above question?

      Thanks!
        • 1. Re: Create a library for all stored procedures
          Tridus
          Sure. Create a new Class Library project. Create a class (or several classes, it doesn't matter) in that. In that class, create a method called Login()

          In that method, you need to handle connecting to the database, running your query, and returning the data. You'd do this exactly the same way you normally would, except you'll be returning some kind of common data class and not Oracle specific objects or connections.

          As to how you connect and run a query, there's lots of resources available for that in the documentation or Google.