Cannot connect VB program with SQL Server 2005 in local machine

5 pts.
Tags:
SQL Server
SQL Server 2005
SQL Server Management Studio 2005
VB.NET
VB.NET 2008
Visual Basic
Visual Basic 2008
The simple program of fetching the data of table through vb.net program. I am retrieving the data into DatagridView . I am writing following String str for connection:
Dim str As String = " Data Source=COMP1SQLEXPRESS ; Initial Catalog=Atuldb; User Id=COMP1comp11;Password= "
my database name is "Atuldb", I am using SQL SERVER MGT STUDIO. In that My server name is  "COMP1SQLEXPRESS", Authentication is "Windows Authentication", User Name is "COMP1comp11", & not given any password. When I compiled program it given " sqlexception was unhandled : Login failed for user ' COMP1comp11'. The user is not associated with a trusted SQL Server connection."

Software/Hardware used:
visual Studio 2008,Sql server mgt studio 2005.

Answer Wiki

Thanks. We'll let you know when a new response is added.

The problem is most likely that SQL server has been configured to work in Windows Authentication Mode so it doesn’t allow using SQL accounts. If that is the case, changing it to work in Mixed Mode should solve the problem.

Take a look at this Microsoft article:

Login failed for user ‘username’. The user is not associated with a trusted SQL Server connection.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • SimpleMind
    Dim str As String = " Data Source=COMP1SQLEXPRESS ; Initial Catalog=Atuldb; User Id=COMP1comp11;Password= "
    dim con as sqlconnection=new sqlconnection(”Data Source= .SQLEXPRESS;INITIAL CATALOG=<sql database name not tablename>;Intregrated Security=SSPI;”)
    hope these may help you!
    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following