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
Iftikar HussainPosted Jul 18, 2013, 6:59 AM
frmView view = new frmView();
view.Show();
view.Location = new Point(0, 50);
Regards,
Iftikar
MANEESH ANPosted Jul 18, 2013, 6:53 AM
Iftikar HussainPosted Jul 18, 2013, 6:27 AM
Regards,
Iftikar
MANEESH ANPosted Jul 18, 2013, 6:23 AM
i got null in the value of parameter in asp.net?
i dont get textbox name in form2 which i made in form1?
Iftikar HussainPosted Jul 18, 2013, 6:21 AM
Regards,
Iftikar
MANEESH ANPosted Jul 18, 2013, 5:36 AM
Form2 form2=new Form2();
form2.SeriesName = txtSeries.Text;
i declare public string vSeries i n form2 also
Iftikar HussainPosted Jul 17, 2013, 8:34 AM
Regards,
Iftikar
MANEESH ANPosted Jul 17, 2013, 8:27 AM
view.@vSeries = @vSeries;
dt = objViewBL.fnPayRegDateView(@vSeries);BUT @vSeries showing null...which not showing any selected value?
I GOT AN ERROR
Procedure or Function 'sp_PaymentRegisterGridView' expects parameter '@vSeries', which was not supplied.
Iftikar HussainPosted Jul 17, 2013, 7:53 AM
public string SeriesName;
and pass the value while loading the form2
and pass this
Regards,
Iftikar
MANEESH ANPosted Jul 17, 2013, 7:50 AM
Iftikar HussainPosted Jul 17, 2013, 7:49 AM
Regards,
Iftikar
MANEESH ANPosted Jul 17, 2013, 7:44 AM
Iftikar HussainPosted Jul 17, 2013, 6:53 AM
Regards,
Iftikar
MANEESH ANPosted Jul 17, 2013, 6:48 AM
Iftikar HussainPosted Jul 17, 2013, 5:59 AM
What error message you are getting while declaring like this
dt = objPaymentBL.fnPayRegDateView(txtSeries.Text);
Regards,
Iftikar
Kunal VaishyaPosted Jul 17, 2013, 5:57 AM