473,466 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OK. This is silly. Do I need a DSN on the server for a SQL connection?

OK. I'm totally a Newb, so cut me some slack.

Here it goes... With all these high falutin features of asp.net do I still
need a dsn for the SQL database/server? Or is this enough to turn the lights
on?

<appSettings>

<add key="DBProvider" value="MSSQL" />
<add key="DBConn" value="data source=server;initial catalog=database;user
id=uid;password=pwd;persist security info=True;packet size=4096" />

</appSettings>

Thanks!

Hugh
Nov 18 '05 #1
1 1408
No you do not need a DSN. If you store your connection string info in your
web.config then you will need to later read it back out and use it.

<appSettings>
<add key="ConnectionString"
value="server=servername;Trusted_Connection=true;d atabase=dbname;Application
Name=myappname"/>
</appSettings>

Dim cn As SqlConnection = New
SqlConnection(ConfigurationSettings.AppSettings("C onnectionString"))

With the above connection string, you would connect to SQL as the ASPNET
user. That user will need right to the database. Or you could supply a SQL
username and password as you were doing. If you also supply an Application
Name it is easier to debug using SQL Profiler. (Just ignore that if that
doesn't make sense to you).

HTH,
Greg

"Hugh G. Johnson" <hu*************@comcast.net> wrote in message
news:S_********************@comcast.com...
OK. I'm totally a Newb, so cut me some slack.

Here it goes... With all these high falutin features of asp.net do I still
need a dsn for the SQL database/server? Or is this enough to turn the
lights
on?

<appSettings>

<add key="DBProvider" value="MSSQL" />
<add key="DBConn" value="data source=server;initial catalog=database;user
id=uid;password=pwd;persist security info=True;packet size=4096" />

</appSettings>

Thanks!

Hugh

Nov 18 '05 #2

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

Similar topics

5
by: Pjotr Wedersteers | last post by:
This may be a silly question, but I was wondering. If 10 clients fill out a form on my page simultaneaously and hit submit, how does my (Apache2.0.50/PHP4.3.8) server exactly ensure each gets...
2
by: michaaal | last post by:
I feel a bit silly asking this because I use this code all the time, but what does the ",,129" mean? Are there other parameters that one might use (I only do fairly simple SQL commands). ...
2
by: Lin Ma | last post by:
Hello, I have a general question. In my asp page, I have DB connection, Recordset, and some variables like dim name, conn, rs set conn = Server.CreateObject("ADODB.Connection") .... set rs=...
6
by: Mike L. | last post by:
Hi, Pls, beware that I'm new to this :) I've developed several web appl, either with ASP or ASP.NET. All using SQL server as the back end. In my development environment, I have a single...
16
by: peshekeedweller | last post by:
Using asp.net 1.1. vb.net 2003. I am trying to connect to a remote sql server 2000 on a virtual machine running windows 2000 server. I can connect through the server explorer in visual studio,...
7
by: Alan Pretre | last post by:
I have an application installed at a customer site that has been getting a general network error for a couple of years. I was hoping that .NET 2.0 would clear it up, but unfortunately it didn't. ...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
3
by: Nemisis | last post by:
Hi everyone, i have currently got a classic asp web application and am wanting to upgrade it to asp.net 2.0, and also take advantage of OOP. Our current application is not using OOP so you can...
6
by: zaina | last post by:
hi everybody i am nwebie in this forum but i think it is useful for me and the member are helpful my project is about connecting client with the server to start exchanging messages between...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.