Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
How to pass dynamically created into Stored procedure through SQL parameters in C#.NET?
Siva R
12y
12.5k
0
Reply
Submit
SqlCommand cmd = new SqlCommand("Sp_Bank");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ActionId",SqlDbType.Int);
cmd.Parameters.Add("@Aref", SqlDbType.Decimal);
cmd.Parameters.Add("@Aref", SqlDbType.Decimal);
***********All The Parameter****************
int result = cmd.ExecuteNonQuery();
Swa M
12y
0
---Create Store procedure Like
==============================================
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author:
piyush sardhara
-- Create date: <11-04-11>
-- Description:
-- =============================================
ALTER PROCEDURE [dbo].[Sp_Bank]
(
@ActionId
int=0,
@Aref
numeric(18, 0)=0,
@BName
nvarchar(50)='',
@AcName
nvarchar(50)='',
@acno
nvarchar(50)='',
@ifsc
nvarchar(50)='',
@branch
nvarchar(50)='',
@blogo
nvarchar(MAX)=''
)
AS
BEGIN
if @ActionId=0
BEGIN
insert into Bank(BName,AcName,acno,ifsc,branch,blogo)
values(@BName,@AcName,@acno,@ifsc,@branch,@blogo)
END
END
===============================================
--pass value like this in Cs Page
===============================================
string[] pAdd = new string[6];
pAdd[0] = TxtBname.Text.Trim();
pAdd[1] = TxtAName.Text.Trim();
pAdd[2] = TxtAcNo.Text.Trim();
pAdd[3] = TxtIFSC.Text.Trim();
pAdd[4] = TxtBranch.Text.Trim();
pAdd[5] = LblPath.Text.Trim();
================================================
if you like my ans is good rate to me.
piyush sardhara
12y
0
Message