TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Interviews
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
.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
How to pass dynamically created into Stored procedure through SQL parameters in C#.NET?
By
Siva R
in
ASP.NET
on
Mar 03
2012
0
12.4k
2
Post Your Answer
Submit
Mar, 2012
29
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();
0
Mar, 2012
13
---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.
0
Most Popular Job Functions
Developer (2432)
Programmer (1314)
Sr. Developer (872)
Sr. Programmer (452)
Fresher (403)
Tech Lead (394)
DBA (245)
Team Lead (202)
Project Lead (86)
Architect (36)
View All
MOST LIKED QUESTIONS
Why do you want to leave your current company?
What are the advantages of using REST in Web API?
What is ASP.NET Core?
How to iterate through ArrayList in jQuery?
What is the difference between TempData keep() and peek() function?
A class provides a default constructor for me. I write a constructor that takes a string as...
Can multiple catch blocks be executed in a C# program?
what is Sealed class
What were your responsibilities in your previous job ?
What Operating Systems Node.js Supports