473,763 Members | 7,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deploy Problem with ASP.NET SQL Server connection issues

143 New Member
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 3050
ck9663
2,878 Recognized Expert Specialist
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.ob ject).

-- CK
Oct 8 '08 #2
teddarr
143 New Member
How did I connect:

public DataSet GetUID(string uid)
{ DataSet ds = new DataSet();
sqlComm = new SqlCommand();
sqlComm.Connect ion = connectionStrin g;
sqlComm.Command Type = CommandType.Sto redProcedure; sqlComm.Command Text = "Client_GetUID" ; sqlComm.Paramet ers.Add("@uid", SqlDbType.Text, 16).Value = uid;
try
{
Helper.FillData Set(sqlComm, ds, "Users"); sqlComm.Command Text, ds, tableNames, SearchValue);
if (!EventLog.Sour ceExists(sSourc e))
{
EventLog.Create EventSource(sSo urce, sLog);
}
sEvent = "App_Code/DataTier.GetUID Normal Operation"; EventLog.WriteE ntry(sSource, sEvent, EventLogEntryTy pe.Information, 301);
}
catch (SqlException ae)
{
if (!EventLog.Sour ceExists(sSourc e))
{
EventLog.Create EventSource(sSo urce, sLog);
}
sEvent = "App_Code/DataTier.GetUID :" + ae.ToString(); EventLog.WriteE ntry(sSource, sEvent, EventLogEntryTy pe.Warning, 101);
}
return ds;
}

connection string:

Data Source=TedsLapt op;Initial Catalog=VoterTe st;Integrated Security=True;U id=teddarr;Pass word=xxxxxxxx" providerName="S ystem.Data.SqlC lient"

Also tried this using windows authentication
Data Source=TedsLapt op;Initial Catalog=VoterTe st;Integrated Security=True;" providerName="S ystem.Data.SqlC lient"

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 Recognized Expert Specialist
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 New Member
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 New Member
The only message that I am getting is "Cannot open Database xxxxx requested by the login. The login failed. Login failed for user 'ComputerName\A SPNET'. at System.Data.Pro viderBase.DbCon nectionPool.Get Connection(DbCo nnection 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 Recognized Expert Specialist
I think your website is using ComputerName\AS PNET to connect to your sql server. Did you configure your IIS to use Integrated Windows Authentication?

-- CK
Oct 9 '08 #7
teddarr
143 New Member
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 New Member
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
2021
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 Server. It runs great on my development machine. Now, I must deploy it to my website. My website is on a shared server holding lots of websites. The websoervice will not run there. It cannot read my SQL Server
9
8332
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 download a file no problem. My issues come when I try to use the same class with the same commands to access an FTP server on a UNIX box. I can connect and login just fine, but after that all my commands come back "500 'PWD': command not understood."....
0
1150
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 http://localhost/reportserver Additional Information: The attempt to connect to the report server failed. Check your connection
34
2496
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 and I just want to be able to have everyone here use the database at the same time without too much fuss. Do I just have to have access on each machine and let them open it from the server, or is there more to it than that? I just don't want them...
4
7998
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 open the production web.config and change the connection string to the correct one for production. Now I want my customer to keep their sql server username/password secret. They are unable/unwilling to change the web.config each time I make an...
5
2908
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 website is running perfectly, but i want to deploy it.
2
830
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 should i install in customer's PC before deploying windows application?
6
2491
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 already well versed in another installer. My question is mainly dealing with deploying the app dependecies. I think I know where im headed but could use the advice of others who have had more experience. Should i just take all the files in the...
3
6563
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 available in multiple folders (under D:\TestReport) and the .rds file is in a folder called 'Data Sources'. I wrote a VB.Net console application to do the task. I am able to deploy the report files under the specified folders. But I don't know how to...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
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 we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.