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

Deploy Problem with ASP.NET SQL Server connection issues

143 100+
I have been working on an asp.net/sql server project for the last month and finally got to the point where I need to deploy it to IIS(port80)/ inetpub/wwwroot and run it from localhost instead of from within Visual Studio. The project deploys fine but when I go to the page with the first database connection, I get an error that basically says my table in the datatable can not be found. Since the project works great from Visual Studio 2005 I can only assume that there is a problem connecting to sql server. My sql server is set up to allow remote connections. I have tried it using windows authentication and sql server authentication. Is there another configuration setting I'm missing or what?

Thanks,
Ted
Oct 8 '08 #1
8 3039
ck9663
2,878 Expert 2GB
What's your connection string? How did you connect to your db? Could you issue a generic t-sql just to check if you are connected? You mentioned that the error showed that your table is missing. I'm not sure if you are connected or you just need to specify the full qualifier in accessing objects (ie dbname.owner.object).

-- CK
Oct 8 '08 #2
teddarr
143 100+
How did I connect:

public DataSet GetUID(string uid)
{ DataSet ds = new DataSet();
sqlComm = new SqlCommand();
sqlComm.Connection = connectionString;
sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.CommandText = "Client_GetUID"; sqlComm.Parameters.Add("@uid", SqlDbType.Text, 16).Value = uid;
try
{
Helper.FillDataSet(sqlComm, ds, "Users"); sqlComm.CommandText, ds, tableNames, SearchValue);
if (!EventLog.SourceExists(sSource))
{
EventLog.CreateEventSource(sSource, sLog);
}
sEvent = "App_Code/DataTier.GetUID Normal Operation"; EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Information, 301);
}
catch (SqlException ae)
{
if (!EventLog.SourceExists(sSource))
{
EventLog.CreateEventSource(sSource, sLog);
}
sEvent = "App_Code/DataTier.GetUID:" + ae.ToString(); EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Warning, 101);
}
return ds;
}

connection string:

Data Source=TedsLaptop;Initial Catalog=VoterTest;Integrated Security=True;Uid=teddarr;Password=xxxxxxxx" providerName="System.Data.SqlClient"

Also tried this using windows authentication
Data Source=TedsLaptop;Initial Catalog=VoterTest;Integrated Security=True;" providerName="System.Data.SqlClient"

I've just finished putting some event logging code into the program, but the data I got back so far is useless because I haven't put it in early enough in the workflow.

Everything is telling me I am not getting a connection with the database, I just don't know why, nor have I proven 100% that this is what is happening.

Any help is appreciated.

Ted
Oct 8 '08 #3
ck9663
2,878 Expert 2GB
I don't see any problem with your connection string (or maybe am just not seeing it). Try creating a sample apps that uses your connection string and connect to your server. Then do a simple t-sql.You have to isolate the problem first. Since you're not sure yet if it's really a connection problem, might as well find out first.

-- CK
Oct 8 '08 #4
teddarr
143 100+
I know the connection string works from the app when I run it in Visual studio. I use the same connection string from windows apps that I have currently in production.

The problem occurs only after I publish the project to the inetpub/wwwroot folder and run http://localhost from a browser.

I think it is a sql server configuration problem.

I've just littered the login.aspx page with event logging statements. Hopefully there will be a clue in there. I'll put in a method that checks for an open connection and call it from the Page_Load method to see what it says.

I'll run it tonight and report the results.
Oct 8 '08 #5
teddarr
143 100+
The only message that I am getting is "Cannot open Database xxxxx requested by the login. The login failed. Login failed for user 'ComputerName\ASPNET'. at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owingingObject.

This is the text of the SqlException that is recorded in the event viewer.

Everything works great until I publish to inetpub/wwwroot. I'm stumped.

Could it have something to do with database ownership?
Oct 9 '08 #6
ck9663
2,878 Expert 2GB
I think your website is using ComputerName\ASPNET to connect to your sql server. Did you configure your IIS to use Integrated Windows Authentication?

-- CK
Oct 9 '08 #7
teddarr
143 100+
I think you may be hitting on part of the problem.

I have found a website that walks through the configuring of both sql server and the asp.net application. It addresses different scenarios and should get me on the right track.

Here is the link for anyone else who has this problem:

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395
Oct 10 '08 #8
teddarr
143 100+
The steps in the article listed above did lead me to a successful conclusion. It all had to do with 2 missing steps in the security configuration.

Thanks for your help.
Oct 13 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: PocketDeveloper | last post by:
I am an experienced developer...but a novice at creating web services, so please have mercy on me! Here is my question: I developed a fairly simple Webservice that returns a table from SQL...
9
by: craig.overton | last post by:
All, I am currently developing an FTP class in VB.NET. It's kid tested, mother approved when trying to access an FTP Server on a Windows box meaning I can connect, run commands, upload and...
0
by: kai | last post by:
Hi, I use SQL Server 2005 and VS 2005. After I create a report, I try to deploy it to Report Server, I get this error: "A connection could not made to the report server...
34
by: radink | last post by:
Well, I've got my DB ready to go. Now what? I need to host it on our Win2003 server. How do clients use it? I think im getting more confused as I try to figure this out. We are a small company...
4
by: dev648237923 | last post by:
I develop my application on my dev server and then I deploy it to a customer's production server. I store the db connection string in web.config (is this best practice?). When I deploy I have to...
5
by: Mahernoz | last post by:
Hi Everyone! I have a problem here. I have used the latest asp.net membership & profiles functionality in my site. I have 2 roles admin and user. I also have a user named admin. Now, my...
2
by: =?Utf-8?B?dHZpbg==?= | last post by:
Hi, I'm developing small windows application for my customer by using Microsoft Visual Basic 2005 Express Edition(free version) and i create sql database in it. my question is: 1. what...
6
by: AGP | last post by:
I resisted for many years but I've just written my first app in .NET2005 and am looking to deploy my app with a third-party installer. ClickOnce and the VS Installer do not meed my needs and I am...
3
by: balaki | last post by:
Hi, I am working on a Installer Project, which requires to deploy SQL Server 2005 Reports (.rdl files) and Datasource (.rds file). The datasource is common for all reports. The report files are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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...
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)...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.