I am having a little trouble with this...
PartTypesBO _parttypesBO = new PartTypesBO();
private void PartsMaintenance_Load(object sender, EventArgs e)
{
InitializeData();
}
private void InitializeData()
{
SqlCommand cmd = new SqlCommand("spx_PartsMaintenance_Load");
cmd.Parameters.AddWithValue("@division", AspireGlobals.CurrentUser.LocationIndex).SqlDbType = SqlDbType.Int;
BusinessLayer.FillMultipleDataTables("Aspire", cmd, _parttypesBO);
}
private void cboPartType_ListPopulating(MicroFour.StrataFrame.UI.ListPopulatingEventArgs e)
{
e.Parameters[0].Value = _parttypesBO;
e.Parameters[1].Value = BusinessCloneDataType.ClearAndFillFromCompleteTable;
}
I thought I would try this with one BO to see how it works. The error that I am getting is in the GetDataSet overridable function in the dbdatasourceitem class. It states {"Line 1: Incorrect syntax near 'spx_PartsMaintenance_Load'."}. Here is the stack trace:
" 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(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataSet(DbCommand command) at MicroFour.StrataFrame.Business.BusinessLayer.FillMultipleDataTables(String dataSourceKey, DbCommand command, BusinessLayer[] businessObjects) at Aspire.Engineering.PartsMaintenance.InitializeData() in C:\Aspire Projects\AspireSF\Engineering\PartsMaintenance.cs:line 57 at Aspire.Engineering.PartsMaintenance.PartsMaintenance_Load(Object sender, EventArgs e) in C:\Aspire Projects\AspireSF\Engineering\PartsMaintenance.cs:line 42 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)"
Hopefully, this is an easy fix. I am stumped at the moment.
Thanks,
Bill