473,401 Members | 2,127 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,401 software developers and data experts.

.Net configuration problem, unable to open Connection

Hi All,
I have a real simple .Net based website (IIS) using C#.
I just kind of got started to develop using .Net I have a
real simple .Net (.aspx extension). In the page load I am
trying to populate the select item from the database.Code
is real simple something like

SqlConnection conn = new SqlConnection(
ConfigurationSettings.AppSettings["sDataConn1"]
);

try
{
conn.Open();

...
conn.Close();
}
catch ( Exception E )
{
Console.WriteLine( E.Message );
}

It gives an exception saying
"SQL server doesnot exist or access denied"
BTW the same application works on another machine, also I
used a simple console application it works just fine on
both the machines, so I am definite its something of a
environment problem with my website. Any pointers will be
highly appreciated.
I am newbee, please get me started
Oslo
Jul 21 '05 #1
3 1816
Are you passing in the user name and password for the database connection string or are you using integrated security? Lots of people had similar problems with integrated security

----- Oslo wrote: ----

Hi All,
I have a real simple .Net based website (IIS) using C#.
I just kind of got started to develop using .Net I have a
real simple .Net (.aspx extension). In the page load I am
trying to populate the select item from the database.Code
is real simple something like

SqlConnection conn = new SqlConnection(
ConfigurationSettings.AppSettings["sDataConn1"
)

try

conn.Open()

..
conn.Close()

catch ( Exception E

Console.WriteLine( E.Message )
It gives an exception saying
"SQL server doesnot exist or access denied
BTW the same application works on another machine, also I
used a simple console application it works just fine on
both the machines, so I am definite its something of a
environment problem with my website. Any pointers will be
highly appreciated.
I am newbee, please get me starte
Osl

Jul 21 '05 #2
I have tried both without luck. Repeat it just doesn't
work on my local machine but on another exactly similar
server it works like a charm. Also my machine where it
doesn't work, I have written a small App writing to
console it works fine !!! BTW the SQL server in on the
network and am using

SqlConnection conn = new SqlConnection(
"Data Source=172.16.X.X; Initial Catalog=dbname; uid=uid;
pwd=pwd" );
-----Original Message-----
Are you passing in the user name and password for the database connection string or are you using integrated
security? Lots of people had similar problems with
integrated security.
----- Oslo wrote: -----

Hi All,
I have a real simple .Net based website (IIS) using C#. I just kind of got started to develop using .Net I have a real simple .Net (.aspx extension). In the page load I am trying to populate the select item from the database.Code is real simple something like

SqlConnection conn = new SqlConnection(
ConfigurationSettings.AppSettings["sDataConn1"]
);

try
{
conn.Open();

...
conn.Close();
}
catch ( Exception E )
{
Console.WriteLine( E.Message );
}

It gives an exception saying
"SQL server doesnot exist or access denied"
BTW the same application works on another machine, also I used a simple console application it works just fine on both the machines, so I am definite its something of a environment problem with my website. Any pointers will be highly appreciated.
I am newbee, please get me started
Oslo

.

Jul 21 '05 #3
Oslo
In your connection string, you should replace uid with User ID

Tu-Thac

----- Oslo wrote: ----

I have tried both without luck. Repeat it just doesn't
work on my local machine but on another exactly similar
server it works like a charm. Also my machine where it
doesn't work, I have written a small App writing to
console it works fine !!! BTW the SQL server in on the
network and am using

SqlConnection conn = new SqlConnection(
"Data Source=172.16.X.X; Initial Catalog=dbname; uid=uid;
pwd=pwd" )
-----Original Message----
Are you passing in the user name and password for the database connection string or are you using integrated
security? Lots of people had similar problems with
integrated security
----- Oslo wrote: ----
Hi All,

I have a real simple .Net based website (IIS)

using C#. I just kind of got started to develop using .Net I have a real simple .Net (.aspx extension). In the page load I am trying to populate the select item from the database.Code is real simple something like
SqlConnection conn = new SqlConnection( ConfigurationSettings.AppSettings["sDataConn1"
)
try


conn.Open()
..

conn.Close()

catch ( Exception E

Console.WriteLine( E.Message )
It gives an exception saying

"SQL server doesnot exist or access denied
BTW the same application works on another machine,

also I used a simple console application it works just fine on both the machines, so I am definite its something of a environment problem with my website. Any pointers will be highly appreciated.
I am newbee, please get me starte
Osl

Jul 21 '05 #4

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

Similar topics

5
by: Tom Martin | last post by:
I'm a Java Web developer NEWBIE that has inherited a website that fails every 2 hours due to poor connection pooling between Tomcat 4.0.6 and mySQL. In efforts to resolve this problem, I've...
4
by: Jessard | last post by:
Hi Guys and Girls, I have a situation where I am wishing to deploy a .NET dll onto a number of servers. The classes in the DLL will be used by VBScripts. When one of the classes - Connection -...
3
by: Oslo | last post by:
Hi All, I have a real simple .Net based website (IIS) using C#. I just kind of got started to develop using .Net I have a real simple .Net (.aspx extension). In the page load I am trying to...
0
by: te goody | last post by:
Problem summary: Web Site Admin Tool is not generating the application services database (aspnetdb.mdf) in a SS 2005 only environment; i.e. The DB is not found under the app_data directory. The...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
5
by: LRK | last post by:
Earlier this week we set up a second application pool to be able to implement trusted connections between ASP.NET apps and a SQL Server database on a different server. The trusted connection is...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
0
by: bw171 | last post by:
Hopefully, I frame this problem/question correctly. I have some code written/updated in visual studio 2003. This code when setup on other machines where I have installed the Oracle 9i client, and...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.