473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DB Connection String

Hi there, I know this is bad, but let's say I had to do it anyways...is this
correct:
Public Shared conn As New SqlConnection("user id=domain\username;
password=thispassword; initial catalog=dbname; data source=dbserver")

Thanks,
Derek
Nov 20 '05 #1
5 1021
Hi Derek,

The first is the most sended page in this newsgroup.
http://www.connectionstrings.com/

Although I find the second much nicer
http://www.able-consulting.com/ADO_Conn.htm

I hope this helps?

Cor
Nov 20 '05 #2
Hi,

Neglecting the security issues the connection string is correct.

Ken
------------

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:eI*************@tk2msftngp13.phx.gbl:
Hi there, I know this is bad, but let's say I had to do it anyways...is
this
correct:
Public Shared conn As New SqlConnection("user id=domain\username;
password=thispassword; initial catalog=dbname; data source=dbserver")

Thanks,
Derek


--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.0 - Release Date: 6/12/2004
Nov 20 '05 #3
* "Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> scripsit:
Public Shared conn As New SqlConnection("user id=domain\username;
password=thispassword; initial catalog=dbname; data source=dbserver")


In addition to the other replies:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
Thank you all, that is what I have been doing but I keep getting this error:
Login failed for user 'username' also I am pretty sure that I have set this
up correctly inside the DB.

Username has these permission at the database level in SQL 2000:
DB Access = Permit
Roles:
public
db_owner
db_datareader
db_datawriter

What else am I missing??? Thank you!

Derek
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j************@uni-berlin.de...
* "Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> scripsit:
Public Shared conn As New SqlConnection("user id=domain\username;
password=thispassword; initial catalog=dbname; data source=dbserver")
In addition to the other replies:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups....dotnet.framew
ork.adonet>
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5
BTW - When I set the user id to the sa account, it works...hmmmmmmm

"Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> wrote in message
news:eR**************@TK2MSFTNGP12.phx.gbl...
Thank you all, that is what I have been doing but I keep getting this error: Login failed for user 'username' also I am pretty sure that I have set this up correctly inside the DB.

Username has these permission at the database level in SQL 2000:
DB Access = Permit
Roles:
public
db_owner
db_datareader
db_datawriter

What else am I missing??? Thank you!

Derek
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j************@uni-berlin.de...
* "Derek Martin" <dm*****@DONTSPAMMEokstateDOT.edu> scripsit:
Public Shared conn As New SqlConnection("user id=domain\username;
password=thispassword; initial catalog=dbname; data source=dbserver")
In addition to the other replies:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups....dotnet.framew ork.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
0
by: Jay Douglas | last post by:
Hello, I'm trying to create a Data Links Property window that behaves just like the dialog box in Visual Studio .Net for MS Sql Server connections. I've found a lot of examples that use...
5
by: Matt | last post by:
Hello, What is the best way to handle the database connection string for a class library project that will be compiled and used as a .dll? This .dll will be accessed via classic ASP and in...
37
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use)....
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
2
by: Johnson | last post by:
I'm trying to fix a "sub optimal" situation with respect to connection string management. Your thoughtful responses will be appreciated. I just started with a new client who has a bunch of legacy...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.