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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
MANEESH AN
NA
110
46.9k
how to give parameter ?
Jul 17 2013 5:49 AM
DLL
Connection con = new Connection();
con.OpenConnection();
SqlDataAdapter da = new SqlDataAdapter();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con.conSql;
cmd.CommandText = "sp_PaymentRegisterGridView";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@vSeries", vSeries);
DataTable dts = new DataTable();
da.SelectCommand = cmd;
da.Fill(dts);
con.CloseConnection();
return dts;
BLL
public DataTable fnPayRegDateView(string vSeries)
{
DataTable dt = new DataTable();
dt = objPaymentMasterDL.fnPayRegDateView(vSeries);
return dt;
}
UI
DataTable dt = new DataTable();
dt = objPaymentBL.fnPayRegDateView(txtSeries.Text);I CAN'T GIVE txtseries.text....shall i give parameter name @vSeries....but not get output in front end
SP
ALTER PROCEDURE [dbo].[sp_PaymentRegisterGridView]
(
-- @WhereCondition nvarchar(4000),
@vSeries nvarchar(20)
)
AS
begin
-- declare @sqlQuery nvarchar(4000);
-- set @sqlQuery=
SELECT
ACC.dRPDate DATE,
ACC.cVType TYPE,
TS.vSeries SERIES,
ACC.iRPNo VOUCHERNO,
ACM.vAcName HEAD,
ACC.vNarration NARRATION,
ACC.deDRAmount DEBIT,
ACC.deCRAmount CREDIT
FROM tbl_Acc_Voucher AS ACC INNER JOIN
tblSerialNumbers AS TS ON ACC.iSeriesId = TS.iSeriesId INNER JOIN
tbl_Acc_AccountMaster AS ACM ON ACM.iAcID = ACC.iAcID
WHERE TS.vSeries=@vSeries
--+@WhereCondition
--exec sp_executesql @sqlQuery
end
RETURN
Reply
Answers (
16
)
Help for Developing Multi Location Software in c# (winform)
display on grid from combox selected values(add collection)