Print Page | Close Window

I am unable to connect to SQL server database

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2385
Printed Date: 16-Apr-2024 at 2:14am


Topic: I am unable to connect to SQL server database
Posted By: dingsen98
Subject: I am unable to connect to SQL server database
Date Posted: 20-Dec-2010 at 7:38am
Good day everyone,
 
I am currently using the 6.0.6.1 version.
 
our application currently uses silverlight but we decided to improve it by using the features of DevForce
 
Currently, our application is delegated to 2 people, the first person was able to make changes on a few of the objects and was able to run it successfully in his machine. He checked it in afterwards.
 
Then I started to work on this on my machine (after grabbing the latest version ), tries to run it, it did run successfully.
when i clicked an object that was still using silverlight feature, it was able to retrieve the informations correctly.
but when i clicked on another object that uses the the devForce feature, it gave me an error, stating that i am unable to connect ot the server...
 
please see error below..
 
-0-0-
 
Caught exception: LoginException: Unable to login: Unable to connect to SQL Server database. ---> at IdeaBlade.EntityModel.Server.SessionManager.GetPrincipalFromCredential(ILoginCredential pCredential) at IdeaBlade.EntityModel.Server.SessionManager.GetPrincipalFromEncryptedCredential(SessionBundle sessionBundle) at IdeaBlade.EntityModel.Server.SessionManager.GetPrincipal(SessionBundle sessionBundle) at IdeaBlade.EntityModel.Server.SessionManager.Validate(SessionBundle sessionBundle) at IdeaBlade.EntityModel.Server.SessionManager.Login(ILoginCredential credential) at IdeaBlade.EntityModel.Server.EntityServer.Login(ILoginCredential credential) at SyncInvokeLogin(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
 
-0-0-
 
to check if indeed ideablade was able to retrieve information from the database, i created a new project and indeed it was able to retrieve from the database successfully.
 
also, before any changes were made, the application runs smoothly on both of our machines.
 
So I am lost on what caused this problem, I hope someone could enlighten me on this or if anyone has a similar problem
 
thank you very much
aa



Replies:
Posted By: smi-mark
Date Posted: 20-Dec-2010 at 8:01am
You will want to check the app.config of your WEB project. This is where the connection to the database is made from. 


Posted By: jipock
Date Posted: 20-Dec-2010 at 8:52am
I'm "the other person" in the original email.
 
I think you meant "web.config", instead of app.config. In this case, we're both using the same web.config file (it's coming out of TFS). It works completely fine on mine, but not his machine.
 
We are using SQL Security (username / password, not integrated security). Also, he *is* able to access the SQL Server through SQL Management Studio using those credentials.
 
The issue is being through in the IdeaBlade DLLs, so something must be off. I agree this might be some sort of configuration issue, but we aren't seeing where the problem might be.
 
Does anyone have any ideas in tracking this down?
 
One bit of info: I'm using a purchased IdeaBlade license, his is the "Express" version. But, our entity count (at the moment) is less than 10, so it shouldn't matter, right? If we can solve this, and we move our entity count past 10, then we'll purchase more licenses.
 


Posted By: smi-mark
Date Posted: 20-Dec-2010 at 8:58am
Yes, I meant web.config, sorry. The DebugLog.xml in the log folder under the web project is a good place to start. It will tell you exactly which config file it is using. You should see a line like this:

<entry id="10" timestamp="2010-12-18T09:35:26" username="" source="IdeaBlade.Core.TraceFns:CompleteTracingInitialization">IdeaBladeConfig resolution: File: C:\pathtowebproject\web.config - found</entry>

If you are getting any errors from the webserver, you should also see them in here too.


Posted By: jipock
Date Posted: 20-Dec-2010 at 9:18am
I just checked the web.config files (we ARE using the same one) and compared my log file to his log file.
 
They are almost identical up until this point:
 
<entry id="37" timestamp="2010-12-20T10:36:03" username="MYPERSONALCOMPUTER\Jason" source="IdeaBlade.Core.Composition.CompositionHost:GetImportDefSingle">CompositionContext: '-IbDefault-' - Probed for any 'EntityServerQueryInterceptor' and found 'IdeaBlade.EntityModel.Server.EntityServerQueryInterceptor'.</entry>
 
That is where he fails and gets the above error message.
 
ONE THING I'VE NOTICED:
* My entries, starting at the entry: Probed for custom 'UserBase' and found MYNAMESPACE.Models.User' has my MYPERSONALCOMPUTER\Jason as the username. His username is completely empty. This might have something to do with it, right? If there is no username, then there won't be any security credentials, and, thus, he won't be able to see the database, correct?
 
So: How does IdeaBlade determine the UserName it's using for network credentials (not the web.config SQL Server credentials)? One more thing of note: AA is using a corporate computer, joined on the corporate domain, etc.. I'm using a Personal computer and using a domain login whenever challenged.
 
-Jason


Posted By: kimj
Date Posted: 20-Dec-2010 at 12:05pm
That error is coming during Login, so the first question would be whether you have a custom IEntityLoginManager which is accessing a database.  I'm betting not, and that you're defaulting to the AspNetAuthenticatingLoginManager.  If that's the case, the error would be coming when trying to access the aspnetdb database.  
 
The debug log will indicate the login manager in use.   If you are using ASP.NET, then the LocalSqlServer connection string - defined either in web.config or machine.config - will indicate where it's trying to find the aspnetdb.


Posted By: jipock
Date Posted: 20-Dec-2010 at 12:49pm

* We're not using a custom iEntityLoginManager - it's a little advanced for us, at this point in development.. :)

* I've found that if we set the  useAspNetSecurityServices attribute to false, it works.. So, this is a permissions problem.
 
I"ll look more into this later, but for now, we have a work-around. This should be good enough for pushing through our eval.
 
Thanks again, everyone.
 
-J

 




Print Page | Close Window