| | | StrataFrame User
       
Group: StrataFrame Users Last Login: 05/15/2008 9:43:25 AM Posts: 304, Visits: 1,198 |
| | Hi Ben, The exception I'm getting when sch_SheduleBO1 is empty is: 'SQL Exception Unhandled by user code' Line 1: Incorrect Syntax Near ')'. My Code: Me.Sch_ScheduleBO1.FillAll()Me.Sch_ScheduleDetailBO1.FillByParent()If I add 1 record to my Sch_Schedule table, everything works fine. I also attached the DEBUG information for the two fill methods. Stacktrace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack) at MicroFour.StrataFrame.Data.SqlDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack) at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(QueryInformation QueryInfo, OnChangeEventHandler CallBack) at MicroFour.StrataFrame.Data.DataLayer.GetDataTable(QueryInformation QueryInfo, Boolean RegisterNotification) at MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParentPrimaryKey(Object[] ParentPrimaryKeys, Boolean ReplaceCurrentDataTable) at MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParent(BusinessLayer Parent, Boolean ReplaceCurrentTable) at MicroFour.StrataFrame.Business.BusinessLayer.FillByParent() at Avanti.Scheduling.frmMain.frmMain_Load(Object sender, EventArgs e) in C:\Source Code\Scheduling\Avanti Scheduling\Avanti Scheduling\Forms\frmMain.vb:line 75 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.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)
|
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: 05/15/2008 9:43:25 AM Posts: 304, Visits: 1,198 |
| | Just following up to see if I have a problem or if there is a small bug... Thanks Tim |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 1:38:37 PM Posts: 3,775, Visits: 3,950 |
| I have not had a chance to set this up, but it would probably be a good idea to just add a test around the DetailBO1 before calling it. If ScheduleBO1.Count > 0 Then DetailsBO1.FillByParent() End If I will look into this though. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:40:45 PM Posts: 305, Visits: 1,197 |
| | Hi Trent, Just to let you know that today I was bit by the same issue, I got the same error. Obviously using the count test will work in this case, but I think this should be fixed ASAP.
Edhy RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 1:38:37 PM Posts: 3,775, Visits: 3,950 |
| | From what I can tell the issue is that the parent BO doesn't have any records. In that case, just test it prior to calling the Fill method...which is better anyway. This is already on my list. But you are ALWAYS better off being pre-emptive when dealing with emtpy tables, BOs, etc. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 2:40:45 PM Posts: 305, Visits: 1,197 |
| Trent L. Taylor (04/28/2008) But you are ALWAYS better off being pre-emptive when dealing with emtpy tables, BOs, etc.Yes, you are right, I have not even noticed that in the same form I was using the BO.count check as you suggested here and was blocked by the error, and even took the time to check the forums before posting. Well I am still getting used to SF and so far I love it 
Edhy RijoProgytech (Computer Consultants) |
| |
|
|