Hi All,
I have a process that will create some customer payment records, in this process I can not allow a duplicate record to be created, so in my process I need to look for any possible duplicate record and then skip the creation of the duplicate one.
I am trying to do this with the BO.Seek, but I am getting an error which I can not properly identify. Here my code:
strSeekWhere(
"FK_InsuredCustomer=51 and FK_Vehicle=0 and FK_Policy=34 and PaymentNumber=0 and PaymentDueDate=5/31/2008 12:00:00 AM and PaymentAmount=500.0000")If loCurrentPaymentScheduleBO.Seek(strSeekWhere) Then Continue ForEnd IfHere is the exeption error:
SyntaxErrorException
Syntax error: Missing operand after '12' operator.
Source : System.Data
Stack Trace:
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression..ctor(DataTable table, String expression, Type type)
at System.Data.Select..ctor(DataTable table, String filterExpression, String sort, DataViewRowState recordStates)
at System.Data.DataTable.Select(String filterExpression, String sort, DataViewRowState recordStates)
at MicroFour.StrataFrame.Business.BusinessLayer.Seek(String WhereClause)
at IBS_BOL.PolicyBO.CreatePaymentSchedule(Int32 pInsuredCustomerPK, PaymentScheduleBO loCurrentPaymentScheduleBO, DateTime PaymentStartDate, Int32 pVehiclePK) in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\BOL\IBS_BOL\Main Forms BOs\PolicyBO.vb:line 217
at IBS_UI.frmPolicy.tsbCreatePaymentSchedule_Click(Object sender, EventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\UI\Main Forms\frmPolicy.vb:line 389
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
What am I doing wrong here? or is there any other way to try to identify a possible duplicate record in the BO.CurrentView.
Edhy Rijo