Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess Data from SQL Server 2008 Authentication Issues
    primarykey
    data
    text
    <p>I am trying to connect to SQL Server. using this peice of code</p> <pre><code>public static String getDBConnection() { SqlConnectionStringBuilder csBuilder = new SqlConnectionStringBuilder(); csBuilder.InitialCatalog = "AdDatabase"; csBuilder.DataSource = "JAWADAMJAD-PC\\SQLEXPRESS"; csBuilder.UserID = "Jawad"; csBuilder.Password = "123456"; return csBuilder.ConnectionString; } </code></pre> <p>I have added this user name via SQL Server Managment Console. I still cannot figure out why I am not able to connect to SQL Server. Do I have to do anything else to connect successfully? If so what is that? Please HELP!!! I am using Visual Studio 2010 and SQL Server 2008. </p> <p>I am getting the following exception</p> <pre><code> System.Data.SqlClient.SqlException: Login failed for user 'Jawad'. 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 AdServiceNew.Service1.initDB() in C:\Users\OZI TECH\Desktop\AdServiceNew\AdServiceNew\AdServiceNew\Service1.asmx.cs:line 57 </code></pre> <p>I went to SERVER Logs and it says</p> <pre><code>An attempt to login as SQL Authentication Failed. Server is configured for windows authentication only. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload