MANEESH AN

MANEESH AN

  • NA
  • 110
  • 46.9k

ERROR FOUND:SQL DATE TIME OVERFLOW

Jul 20 2013 5:49 AM
Declaration

  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

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 vSeries  convert(datetime,ACC.dRPDate,101)>=convert(datetime,@DTFROM,101)
--AND
--convert(datetime,ACC.dRPDate,101) <= convert(datetime, @DTTO,101)
where vSeries  >=@DTFROM AND vSeries<=@DTTO

END