Public Overrides Function CreatePickListBusinessObject() As OakLeaf.MM.Main.Business.mmPickListBusinessObject if Flag = "local" then Return MyBase.CreatePickListBusinessObject() else Return New MymmPickListBusinessObject end if End Function
<add key="DefaultDataAccessMode" value="wcf" />and have a factory method in my windows application
Public Class Factory Inherits OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop Public Overrides Function CreateDataAccessObject(ByVal dataAccessClassName As String) As OakLeaf.MM.Main.Data.mmDataAccessBase If mmAppBase.DefaultDataAccessMode = mmDataAccessMode.Local Then Return MyBase.CreateDataAccessObject(dataAccessClassName) Else Dim binding As New WSHttpBinding() binding.MaxReceivedMessageSize = 147483647 Dim address As New EndpointAddress("http://ykhanlt/OSPService/Service.svc/mex") Return New mmDataAccessWCFSql(binding, address) End If End Function End ClassI get the following message "The ConnectionString property has not been initialized"
at System.Data.SqlClient.SqlConnection.PermissionDemand() at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() 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, String srcTable) at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbDataAdapter dbAdapter, String tableName, Boolean clearOnFill) at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, IDbCommand command, String tableName, Boolean clearOnFill) at OakLeaf.MM.Main.Data.mmDataAccessSql.FillDataSet(DataSet ds, String command, String tableName, CommandType cmdType, IDbDataParameter[] dataParms, Boolean clearOnFill) at OakLeaf.MM.Main.Business.mmBusinessObject.FillDataTable(DataSet ds, String command, String tableName, String databaseKey, CommandType cmdType, IDbDataParameter[] cmdParams) at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, String databaseKey, CommandType cmdType, IDbDataParameter[] cmdParams) at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, String databaseKey, IDbDataParameter[] cmdParams) at OakLeaf.MM.Main.Business.mmBusinessObjectGeneric`1.GetEntityList(String command, IDbDataParameter[] cmdParams) at ACELO.OSP.BUSINESS.OSPSCHOOLIDENTIFIER.GetActiveSchoolInfo(Boolean Active) in C:\OSMS\Acelo.OSP.Business\Acelo.OSP.Business\OSPSCHOOLIDENTIFIER.vb:line 109 at ACELO.OSP.WINDOW.ACHProcessForm..ctor() in C:\OSMS\Acelo.OSP.Window\Acelo.OSP.Window\ACHProcessForm.vb:line 70 at ACELO.OSP.WINDOW.ACHProcessForm.get_FormInstance() in C:\OSMS\Acelo.OSP.Window\Acelo.OSP.Window\ACHProcessForm.vb:line 80 at ACELO.OSP.WINDOW.MainForm.TestToolStripMenuItem_Click(Object sender, EventArgs e) in C:\OSMS\Acelo.OSP.Window\Acelo.OSP.Window\MainForm.vb:line 66 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.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.ToolStripDropDown.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.ToolStripDropDown.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at ACELO.OSP.WINDOW.AppMainEntry.Main() in C:\OSMS\Acelo.OSP.Window\Acelo.OSP.Window\Main.vb:line 53Thanks