Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / August 2003

Tip: Looking for answers? Try searching our database.

Accessing SQL Server Database from VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mbakshi - 27 Aug 2003 23:27 GMT
I'm trying to access a SQL database that is set up on a
Windows 2003 Enterprise machine on my network through my
VB.NET app.

I started with the following simple code just to make sure
I could access the database:

       Dim ConnectionString As String
       ConnectionString = "Password=" & DBPassword
& ";User ID=" & DBUsername & ";" & "Initial Catalog=" &
DBName & ";Data Source=" & DBServerHostname & ";"
       Dim DBConn As New SqlClient.SqlConnection
(ConnectionString)
       DBConn.Open()

I verified that everything was correct in the connection
string, etc., but I was getting SQL access errors, so I
decided to try to add a Data Connection in the Server
Explorer.

I can successfully add the server to the Server Explorer
and can access everything (e.g. event logs, performance
counters, services, etc.).  When I open the "SQL Servers"
item and click on the item underneath, a dialog pops up
asking for the username and password for the database.  
Even if I enter the correct info, I get an error
stating "Login failed for user '(username)'.  Reason: Not
associated with a trusted SQL Server connection.

What does that mean and how can I fix it?

I've had some experience writing and modifying existing
things like stored procs for existing databases but have
not worked before with creating a new database from
scratch and doing all this.  Below is what I did, just to
make sure I didn't do anything wrong on the SQL server:

-Created new database under 'local' under 'Microsoft SQL
Servers'
-Added new user to database with dbo rights
(authentication not based on Windows Authentication)
-Added new table to database
-Added columns to table (one is primary key)

Is there anything I missed there?

Thanks
Dino Chiesa [MSFT] - 29 Aug 2003 18:10 GMT
May I suggest...?

http://support.microsoft.com/default.aspx?scid=kb;en-us;307002
and
http://www.google.com/search?hl=en&num=30&q="Not+associated+with+a+trusted"

-Dino

> I'm trying to access a SQL database that is set up on a
> Windows 2003 Enterprise machine on my network through my
[quoted text clipped - 43 lines]
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.