GO
ALTER PROCEDURE [dbo].[sp_PaymentRegisterGridView]
(
@DTFROM datetime,
@DTTO datetime
-- @vSeries nvarchar(20)
)
AS
BEGIN
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 ACC.dRPDate between 01-07-2013 and 05-07-2013
where convert(DATETIME,ACC.dRPDate,101)>=convert(DATETIME,@DTFROM,101)
AND
convert(DATETIME,ACC.dRPDate,101) <= convert(DATETIME, @DTTO,101)
END
BUTTON VIEW
BL
f rmView view = new frmView();
view.vSeries = txtSeries.Text;
view.Show();
view.Location = new Point(0, 50);
DataTable dt = new DataTable();
dt = objPaymentBL.fnGetPayReg(FROM,TO);
BL
public DataTable fnGetPayReg(DateTime FROM, DateTime TO)
{
DataTable dt = new DataTable();
dt = objPaymentMasterDL.fnGetPayReg(FROM, TO);
return dt;
}
DL
IS NEED TO WRITE FORM2 LOAD AFTER CLICK ON BUTTON VIEW IN FORM 1?DL
public DataTable fnGetPayReg(DateTime FROM, DateTime TO)
{
Connection objCon = new Connection();
SqlParameter[] parmsDetails = new SqlParameter[1];
parmsDetails[0] = new SqlParameter();
parmsDetails[0].SqlDbType = SqlDbType.DateTime;
parmsDetails[0].Value = FROM;
parmsDetails[0].ParameterName = "@DTFROM";
parmsDetails[0] = new SqlParameter();
parmsDetails[0].SqlDbType = SqlDbType.DateTime;
parmsDetails[0].Value = TO;
parmsDetails[0].ParameterName = "@DTTO";
DataTable dt = new DataTable();
dt = objCon.fnSelectData("sp_PaymentRegisterGrid", parmsDetails);
return dt;
}
MANEESH ANPosted Jul 20, 2013, 5:12 AM
DateTime DTFROM;
DateTime DTTO;
string vSeries;
button view
frmView view = new frmView();
view.vSeries = txtSeries.Text;
view.Show();
view.Location = new Point(0, 50);
DataTable dt = new DataTable();
dt = objPaymentBL.fnGetPayReg(DTFROM, DTTO);
view.DTFROM.Text = DtpDateFrom.Value.Date.ToString() + "TO" + DtpDateTo.Value.Date.ToString();
BL
DateTime dRPDate;
DateTime FROM;
DateTime TO;
public DateTime DTFROM
{
get { return FROM; }
set { FROM = value; }
}
public DateTime DTTO
{
get { return TO; }
set { TO = value; }
}
public DataTable fnGetPayReg(string vSeries,DateTime FROM, DateTime TO)
{
DataTable dt = new DataTable();
dt = objPaymentMasterDL.fnGetPayReg(vSeries,DTFROM, DTTO);
return dt;
}
DL
public DataTable fnGetPayReg(string vSeries,DateTime FROM, DateTime TO)
{
DataTable dt = new DataTable();
dt = objPaymentMasterDL.fnGetPayReg(vSeries,DTFROM, DTTO);
return dt;
}
GRID
DECLARATION
DateTime DATEFROM;
DateTime DTTO;
public DateTime FROM
{
get { return DATEFROM; }
set { DATEFROM = value; }
}
public DateTime TO
{
get { return DTTO; }
set { DTTO = value; }
}
GRID LOAD
DateTime @dRPDate;
DataTable DT = new DataTable();
DT = objViewBL.fnGetPayReg(FROM, TO);
ONLY ON FIELD 'drpdate' is inserted in one table,series is inserted in another table,when form come up,we will select series,date from.datet to and click view button,that time grid will come up within the region of date and time...how can i go?Error found:SQL DATETIME OVERFLOW.....I DONT KNOW THE FORMAT OF DATE HOW TO GIVE?I HAD SENT ALREADY OUTPUT OF SP(THERE YOU CAN SEE DATE VALUE OF DATETIME)...
SP
Iftikar HussainPosted Jul 20, 2013, 4:21 AM
Regards,
Iftikar
MANEESH ANPosted Jul 20, 2013, 3:52 AM
MANEESH ANPosted Jul 20, 2013, 3:17 AM
Iftikar HussainPosted Jul 20, 2013, 3:14 AM
Regards,
Iftikar
MANEESH ANPosted Jul 20, 2013, 3:11 AM
19-JUL-2013
Iftikar HussainPosted Jul 20, 2013, 2:58 AM
Regards,
Iftikar
MANEESH ANPosted Jul 20, 2013, 2:55 AM
Iftikar HussainPosted Jul 20, 2013, 2:44 AM
Regards,
Iftikar
MANEESH ANPosted Jul 20, 2013, 2:42 AM
Iftikar HussainPosted Jul 20, 2013, 2:39 AM
What the issue you are getting now?
Regards,
Iftikar