New Posts New Posts RSS Feed: Issues Connecting to the Database
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Issues Connecting to the Database

 Post Reply Post Reply
Author
DavidKozikowski View Drop Down
Groupie
Groupie
Avatar

Joined: 02-Feb-2010
Location: Aurora, IN
Posts: 59
Post Options Post Options   Quote DavidKozikowski Quote  Post ReplyReply Direct Link To This Post Topic: Issues Connecting to the Database
    Posted: 09-Jun-2010 at 6:05am
Originally posted by ting

No, we were able to simplify the configuration so that the <edmKeys> are no longer needed.  Just make sure the database information is in the <connectionStrings> node of the app.config.

 
I am having issues connecting to the DB
I have 2 edmx one is for a local sql instance and the other is for a remote Oracle instance. This is what the App.config
file looks like. Of course the password userid and server name have been "blanked" out for this post.
 
When I try to do something like the below I get the Error.
**************************************************************************

static GTDMEntityManager _manager = GTDMEntityManager.DefaultManager;

IdeaBlade.Util.BindableList<TTKSMA804100> _TTKSMA804100 = new IdeaBlade.Util.BindableList<TTKSMA804100>();

_TTKSMA804100.ReplaceRange(_manager.TTKSMA804100.ToList());
 
 
*******************************************************************

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<connectionStrings>

<add name="PTXARCEntityManager" connectionString="metadata=res://*/PTXARCModel.csdl|res://*/PTXARCModel.ssdl|res://*/PTXARCModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=(local);Initial Catalog=PTXARC;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

<add name="GTDMEntityManager" connectionString="metadata=res://*/GTDMModel.csdl|res://*/GTDMModel.ssdl|res://*/GTDMModel.msl;provider=Devart.Data.Oracle;provider connection string=&quot;User Id=ME;Password=*******;Server=comp.AD.NAME.COM;Persist Security Info=True&quot;" providerName="System.Data.EntityClient" />

</connectionStrings>

</configuration>

*******************************************************************
 
IdeaBlade.EntityModel.EntityServerException was unhandled
  Message=Key 'GTDMENTITYMANAGER': Parameter 'connectionString' is not valid. String arguments cannot be empty.
Parameter name: connectionString A default IdeaBladeConfig is in use and does not contain either connectionStrings or EdmKeys. Ensure a valid configuration file containing connection information is present, or implement a custom IDataSourceKeyResolver.
  Source=IdeaBlade.EntityModel
  Cancelled=false
  StackTrace:
       at IdeaBlade.EntityModel.EntityManager.HandleEntityServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation)
       at IdeaBlade.EntityModel.EntityManager.ExecuteServerQuery(IEntityQuerySurrogate entityQuery)
       at IdeaBlade.EntityModel.EntityManager.ExecuteFetch(IEntityFinder finder)
       at IdeaBlade.EntityModel.EntityQueryFinder.Execute()
       at IdeaBlade.EntityModel.EntityManager.ExecuteQueryCore(IEntityQuery query, Boolean isAsync)
       at IdeaBlade.EntityModel.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
       at IdeaBlade.EntityModel.EntityQueryExtensions.Execute[T](IEntityQuery`1 query)
       at IdeaBlade.EntityModel.EntityQuery`1.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at GTDM_2010.Admin.Admin_Load(Object sender, EventArgs e) in C:\Users\dkozikow\Documents\Visual Studio 2010\Projects\GTDM\GTDM 2010\Admin.cs:line 33
       at System.Windows.Forms.Form.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.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
       at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Control.set_Visible(Boolean value)
       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.RunDialog(Form form)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at System.Windows.Forms.Form.ShowDialog()
       at GTDM_2010.Main.adminToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\dkozikow\Documents\Visual Studio 2010\Projects\GTDM\GTDM 2010\Main.cs:line 116
       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.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.MenuStrip.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(IntPtr 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 GTDM_2010.Program.Main() in C:\Users\dkozikow\Documents\Visual Studio 2010\Projects\GTDM\GTDM 2010\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.ArgumentException
       Message=Parameter 'connectionString' is not valid. String arguments cannot be empty.
Parameter name: connectionString
       Source=System.Data.Entity
       ParamName=connectionString
       StackTrace:
            at System.Data.EntityUtil.CheckStringArgument(String value, String parameterName)
            at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
            at System.Data.Objects.ObjectContext..ctor(String connectionString)
            at IdeaBlade.EntityModel.Edm.EdmKey.CreateContext()
       InnerException:
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jun-2010 at 3:56pm
David, is this still an open issue for you?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down