Inserting values Using Stored Procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hellboss
    New Member
    • Jun 2007
    • 50

    #1

    Inserting values Using Stored Procedure

    Hi !
    Iam working in asp.net in Visual Studio 2005. I tried to insert some datas from the webform's interfaces into the SQL Server 05 database using a stored procedure. Since iam new to asp.net,im confused wheather to use any command or anything else ? Kindly Help me !
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    You can either directly execute the text command or can execute the same through a procedure.For that u need to write stored procedure in database. If you know that then go for it. But for that u need some extra coding in the front end. But performance wise using a stored procedure is better.

    Comment

    • hellboss
      New Member
      • Jun 2007
      • 50

      #3
      Originally posted by debasisdas
      You can either directly execute the text command or can execute the same through a procedure.For that u need to write stored procedure in database. If you know that then go for it. But for that u need some extra coding in the front end. But performance wise using a stored procedure is better.
      Can you give me some sample coding !

      Comment

      • patelaashish
        New Member
        • Oct 2006
        • 26

        #4
        Originally posted by hellboss
        Can you give me some sample coding !
        The stored procedures is as follows


        CREATE PROCEDURE TEST
        @field1 nvarchar(50),
        @field2 numeric(10)
        AS
        BEGIN
        INSERT INTO TABLE1 (field1,field2) VALUES (@field1,@field 2)
        END

        Hope this helps.

        Thanks,

        Comment

        Working...