C# Tutorials and offshore development in India

Tutorials Resources Forum Reviews Interview Jobs Projects Training Your Ad Here


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...




Forums » .NET » .NET »

How to Insert Data using Stored Procedures


Posted Date: 17 May 2006      Posted By: DUVVALA SRINIVASA RAO      Member Level: Silver     Points: 2   Responses: 3



How to Insert Data using Stored Procedures using sqlserver2000.I need code in .net & also Stored procedure query.plz help me out




Responses

Author: Rajendra kumar Yerra    17 May 2006Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi
this is sample stored procedure

create PROCEDURE [dbo].[Share_Insert]
@Company varchar(50),
@Share float(53),
@Date datetime
AS
SET NOCOUNT ON

INSERT INTO [Share]
(
[Company],
[Share],
[Date]
)
VALUES
(
@Company,
@Share,
@Date
)




Author: archana     17 May 2006Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Please refer to these link.


Author:     18 May 2006Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

consider the above stored procedure ..how to acess thru .net...

v hav to create as usal connection,command object..
SqlConnection con = new SqlConnection("Data Source=10.228.21.6;Initial Catalog=CFE_DEV;User ID=sa;PassWord=cfecmc2122@");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommmandType.StoredProcedure;
cmd.CommandText = "Share_Insert";//storeprocedure name
cmd.parameters.add("Company","abc");
cmd.parameters.add("Share",15.25);
cmd.parameters.add("Date","17/05/06");
cmd.executenonquery();
con.close();



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : what is difference between String and string(data type) in c#?
Previous : what is a resource file...
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages




About Us    Contact Us    Privacy Policy    Terms Of Use