Solved

sqlclient connection

Posted on 2006-10-28
3
628 Views
Last Modified: 2008-03-06
I have c# 2005 and I plan on connecting to a sql 2000 database. What is the best performance\reliablity connection string and how should it work.

I am use to using the odbc but it would be nice to see what others are using with the new version plus eliminating the slow speed and having to create an odbc on clients pcs that will be using the application.

the applications will be used internally and possibly users at home connecting via a vpn connection.

0
Comment
Question by:bman9111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17826440
You should stick to the SqlConnection, etc, objects because they use the native Sql Server drivers and are much faster than the Odbc and OleDb equivalents.
0
 
LVL 8

Author Comment

by:bman9111
ID: 17826500
could you provide some coding please?
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17826508
In it simplest format:

    SqlConnection cn = new SqlConnection("Server=YourServerName;UID=aUser;PWD=aPassword;Initial Catalog=YourDatabase;");              // Using SQL Authentication

    SqlConnection cn = new SqlConnection("Server=YourServerName;Integrated Security=SSPI;Initial Catalog=YoruDatabase;");                   // Using windows authentication

The rest of your code would be the same as it is for Odbc, only the object type changes.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question