Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Problem DbFit with SQL Server 2008

Author  Topic 

chan_nguyen
Starting Member

4 Posts

Posted - 2010-07-06 : 23:26:47
I knew this is kinda off-topic, but I have no way to go :( I tried to google for several days, and all I got is nothing :(.
I followed this tutorial, very simple and straight forward.
http://www.fitnesse.info/dbfit:reference:databaseunittests:helloworld
Everything went well except this line :

!|Connect|SERVICE_NAME|USER_NAME|PASSWORD|DATABASE_NAME|

I'm so confused about the SERVICE_NAME here. I don't know where to get SERVICE_NAME, USER_NAME, and PASSWORD for my SQL Server. From using Microsoft SQL Server Management Studio, I put :

!|Connect|CHAN-PC/SQLEXPRESS|CHAN-PC/Chan| |MyDataBase|

Unfortunately, this failed badly. And these are the errors that I got from DbFit :

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: Login failed for user 'chan-PC\chan'.
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 dbfit.AbstractDbEnvironment.Connect(String connectionString) in D:\work\dbfit\impl\dotnet\src\environment\AbstractDbEnvironment.cs:line 66
at dbfit.DatabaseTest.Connect(String dataSource, String username, String password, String database) in D:\work\dbfit\impl\dotnet\src\DatabaseTest.cs:line 26
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at fitlibrary.Method.Invoke(Object[] theParameters)
at fitlibrary.Method.Invoke(Fixture theFixture, IEnumerable theCells)
at fitlibrary.FlowFixtureBase.ExecuteMethod(Method theMethod, CellRange theCells)
at fitlibrary.FlowFixtureBase.ProcessFlowRow(Parse theCurrentRow)


If anyone have used Dbfit before, please help me :( ?
Thanks,

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-07-07 : 04:46:50
The generic method of connecting seems a lot simpler:

!|Connect|Data Source=CHAN-PC\SQLEXPRESS;Initial Catalog=myDataBase;Integrated Security=SSPI;|



- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page

chan_nguyen
Starting Member

4 Posts

Posted - 2010-07-07 : 10:15:31
Hi Lumbago,
First thanks a lot for your quick reply. It worked perfectly, all I need to do is just add a Password for myDataBase. Can I ask you something about those command above?
- What does Integrated Security do? What is role here?
Also, do you have any document for those commands? so that I can try to figure out myself next time.
Thanks,
Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-07-08 : 03:00:11
You can check out www.connectionstrings.com, they have documentation for all the connectionstrings you can think of. Integrated security means that the connection is authenticated with the the current windows account that is initiating the connection. If you want to specify a username and password, this is called sql server authentication and you will have to create the user in the "security -> logins"-section under your server in management studio and then give it the appropriate permissions in the "user mapping" of this window ->



- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page
   

- Advertisement -