DbUtil.cs CONN error

Jul 1, 2013 at 11:55 AM
After running the project and trying to login as admin, i got a error back from the system in the DbUtil.cs.
I looks like that he did not reconise the CONN command?
Or is this a problem with the sql connectionstring?

I'm working on my laptop as you can see.

<add name="cs" connectionString="Data Source=.\Data Source=(FRED-LAPTOP\ITYMSQLSERVER\v11.0);Database=SurveyMaster;UID=sa;pwd=1;" />
Jul 1, 2013 at 11:57 AM
could be the connection string
have you tried debugging ?
what's the stack trace
Jul 1, 2013 at 1:19 PM
Thankz, I now installed a new instance of SQL Express and it almost workt. I now get a error {"Login failed for user 'sa'."}.
Jul 1, 2013 at 2:17 PM
The stack trace is now:
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.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at MRGSP.SurveyMaster.Data.DbUtil.CountWhere[T](Object where, String cs) in C:\Users\Fred\Desktop\Assessmentsite\SurveyMaster4\SurveyMaster\Data\DbUtil.cs:line 54
at MRGSP.SurveyMaster.Data.Repo1.CountWhere(Object where) in C:\Users\Fred\Desktop\Assessmentsite\SurveyMaster4\SurveyMaster\Data\Repo.cs:line 82
at MRGSP.SurveyMaster.Service.Services.UserService.Exists(String login, String password) in C:\Users\Fred\Desktop\Assessmentsite\SurveyMaster4\SurveyMaster\Service\Services\UserService.cs:line 55
at MRGSP.SurveyMaster.WebUI.Controllers.AccountController.LogOn(String login, String password, Nullable
1 rememberMe) in C:\Users\Fred\Desktop\Assessmentsite\SurveyMaster4\SurveyMaster\WebUI\Controllers\AccountController.cs:line 27
at lambda_method(ExecutionScope , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
Jul 1, 2013 at 2:22 PM
think you have something wrong with the connection string or with the db/users setup, if you google for : Login failed for user 'sa'
I'm sure you'll find plenty of posts about this
Jul 3, 2013 at 11:07 AM
It worked.

But....... it seems not to writh the data into the database. Ik can make questionaries and run them, but when i look at the sql database, i do not see the anwers in the table.

Also i see that when a user has filled in a survey, i as admin can not make any changes to the survey laayout?
Jul 3, 2013 at 2:21 PM
Aha, now i fixed this problem, it was in the config files. But now it communicate with SQL an retreved data as login names, questions, etc.
But it do not write back the anwses in the anser table.
Jul 3, 2013 at 2:25 PM
have you read the readme.txt
Jul 3, 2013 at 3:06 PM
Yes, did it again.

But strange thing is that it seems to work perfectly, i can create acounts in the application and do it directly in SQL management studio. It works, but when i fill in a surfey i created, it seems to work.
But when i look at the table anwsers, i do not see any values writhen in to it.

I can see who (idnumber) has taken a surfey.
Jul 3, 2013 at 3:15 PM
are the unit tests running for you ?
Jul 4, 2013 at 12:14 PM
Yep, no problem.

Is there a database design flow chart available?
Jul 4, 2013 at 1:18 PM
I'm missing the getresult.sql in the zip file. Is this correct? And do i have to run it to get the writing back data to the answer table?
Jul 4, 2013 at 1:29 PM
Sorry, tryed that out and it is clear now that is a script to get the info out of sql for reporting ;-)
Jul 4, 2013 at 1:32 PM
So, i hope the last question on this.....

Where can i analyse the writing back the type or selected data in a survey? So that i can get into the code to look for a solution on this?
Jul 4, 2013 at 2:58 PM
Found it!!!!!

It is not in the asp code but in the sql.
There is no link between the some tables. So something is not going oke when running the script files. I so that in the sql diagramm. I made the link and it work great now.