473,320 Members | 1,933 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,320 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 1812
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.