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 / Languages / Managed C++ / June 2005

Tip: Looking for answers? Try searching our database.

MC++ && MS SQL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hangaround - 12 Jun 2005 11:15 GMT
I have read some codes like following:
///////////////////////////////////////////
   SqlConnection* conn =
     new SqlConnection(S"Server=localhost;"
                       S"Database=Northwind;"
                       S"Integrated Security=true;");

   adapter = new SqlDataAdapter(S"SELECT * FROM Employees", conn);

   eventHandler = new SqlEventHandler(adapter, this);

   commandBuilder = new SqlCommandBuilder(adapter);

   conn->Open();
///////////////////////////////////////////

  I wondered can we link to the database without username and password?
Tim - 13 Jun 2005 10:43 GMT
In your example, you are doing exactly that - you are using a Trusted
Connection aka Integrated Security aka SSPI context. The Trusted connection
is the logged on connection you already have. This needs to be setup in SQL
Server.

The alternative is to specify a UserName and Password in the SqlConnection -
this username and password has to be registered in SQL Server with
permissions to the database(s) and objects you require.

- Tim

>I have read some codes like following:
> ///////////////////////////////////////////
[quoted text clipped - 13 lines]
>
>   I wondered can we link to the database without username and password?

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.