Showing posts with label aspnet. Show all posts
Showing posts with label aspnet. Show all posts

Friday, March 23, 2012

Problem reaching sqlserver2000 database with asp.net 2.0 application when deploying


I have developped an ASP.NET 2.0 webb application localy on my workstation and have the MSSQL2000 database on a
server.There has been no problem accessing the database during development.

Im now finnished and put the application on a web server.

No when i try to access the application i get the following problem as it tries to reach the database:

An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I still use the same database so remote connections are allowed and there are lot of application against that sqlserver already running.

I have anonumouse access and use a domain service account for the application and that very same account is added
as a login to the sqlserver and a domain\user in the database.

I have Forms authentication in my web.config file.


the connectionstring i use look like this:

<appSettings>
<add key="app1" value="Data Source=server01;Initial Catalog=database1; Integrated Security=SSPI;"/>
</appSettings>


Can somebody please tell me what is wrong and how to fix it. I dont change any configuration betweeen my workstation and the server in web.config

/ in pain!!

Hi Vader,

Use IP Address of your server to describe Data Source in your config settings like 192.192.xx.xx

<appSettings>
<add key="app1" value="Data Source=192.192.xx.xx;Initial Catalog=database1; Integrated Security=SSPI;"/>
</appSettings>

I hope this will work..Yes

Wednesday, March 21, 2012

Problem Opening Databases In ASP.NET

I Have A Problem With Opening A Database With "SQLOLEDB" Provider In Web Application Projects!
The Same Database Opens In Windows Application Projects But When I Try TO Open It (Manually Or During A DataAdapter.Fill Method) In Web APPS I Get An Error Message : "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'."
I Use Windows NT Authentication In Connections,
I Have SQL Server 2000 Enterprise Edition (With Default Installation) , Windows .Net Server 2003 Enterprise Edition (IIS 6) , And VS.NET 2003 Enterprise Edition (.Net Framework 1.1)
Can Anyone Tell Me What's Wrong?You need to give the ASPNET user (or the user under which the worker process is running) the appropriate rights to your database.|||Thanks For Your Advice
I Solved That Problem By Adding A New User And Settting Permissions For It
By The Way , IT Came To My Mind That I Can Use ASPNET Account , But I Don't Know The Password , It Is'nt Blank And I Did'nt Set It Myself , n I Don't Know If I Change The Password Using Computer Management / Local Users , Would Be Anything Affected?
OR ASPNET Account Is Only For This Particular Use?


Note from moderator SomeNewKid:
Please refrain from capitalizing every word. Not only does it make your post hard to read,
it also means we cannot distinguish Class names and members.|||Typically, the ASPNET user has a system generated account and is local to the machine that the website is on. At work, we use a domain-level account for our web farm and that user then has rights to our app server tier for our file share for uploading/downloading files.

I was thinking of giving your ASPNET windows user rights to the database and using integrated security...

Your database user configuration is more portable and should work just as well.

Tuesday, March 20, 2012

problem of uploading asp.net website on web server

i have developed a website using asp.net, c# withSQL SERVER EXPRESS EDITION 2005. The database is being used both for retreival and updation purpose. the website is working accordingly when i m running it on my system, ie., data is getting retreived from the database and it is also getting updated on button click. But when i m uloading my site on the httpdocs folder of web server, connectivity with database is failing miserably, ie neither getting retreived from the database nor getting updated. The error message displayed by the web server is given underneath. i have used Grid view for displaying data from the database and Details view for updating the database.

i have used window authentication for connecting with the database.

Please help me with finding out a solution for it. give me proper explanation and i need to do

Server Error in '/' Application.

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

smartymca:

this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections

Have you checked to see if this is the case or not? Simply pasting this error into google should show you how to do this.

|||

Hello smartymca,

I have recently uploaded my first ASP.NET website to the web, and I had exactly the same problem and error message. I found there were two reasons for this:

1. My hosting company require that my SQL Server database be located on a different server to the rest of my files! So check with your provider to see if your database needs to be in a specific place. I had to remove my database from my App_Data folder and recreate it on the correct server. I also had to change the connection string in my application to match the database's new location.

2. Now that my database was on a different server, the login system didn't work! This was because the default connection string for the Membership provider was no longer valid. There is however a very good video on this website that guides you through setting this up. It's the"ASP.NET How Do I? #13" video.

I hope this helps. If you think your problem is caused by the same thing then write back and maybe I can help.

|||

You will probably want to you SQL authentication because chances are, the SQL Server and the application server are on two different servers.

Who is your host?

|||

my web services provider is PROWEBS (prowebs.co.in).

|||

thanks for your reply. Yes i think my problem is same as your's, so please guide me.

My provider is (prowebs.co.in).

Tell me the steps you followed.

|||

smarty,

I've had a look at your provider's website and it appears to be exactly the same setup as my provider. You have to place your SQL Server database on a specific server for it to work - in your case, it is the "3Essentials MSSQL" server.

Unfortunately you cannot simply copy your existing database to the server (I had the same problem). A new empty database must be created on the 3Essentials server. Then, there are two things you can do.

If your database is still quite small and simple, you could recreate the tables yourself by connecting to your new database through MS Visual Studio. This is what I did.

If your database already has a lot of data in it and would take too long to recreate, you can transfer the data from your old database to your new database. This requires making a backup of your database using MS SQL Enterprise Manager (supposedly free to download from Microsoft, although when I tried, the download wasn't there) and then sending this backup to your provider so they can upload it for you. Detailed instructions can be found in your provider's FAQ.

smarty - are you using MS Visual Studio? If so, and you would like to try the first option, let me know and perhaps I could walk you through it. Send me a private message.

Patrick

|||

Patrick,

thnx for ur prompt reply..........

yes i m using MS Visual Studio and m also interested in using the first option............So, plz guide me through...........

|||

Ok,

1. Login to your user account at Prowebs. Find the database management section, and create a new MS SQL 2005 database. You'll give it a name, and a username and password.

2. Find out the server address for your new database. I guess it will be something like sql.3essentials.com. Also try and find out the connection string - my hosting company has a neat tool that tells you what it is. If yours doesn't, don't worry - you can find out in Visual Studio later.

3. Open up Visual Studio 2005. Click on the View menu and choose Server Explorer. Click on 'Connect to Database'.

4. In the new window, select the following options:

Datasource: Microsoft SQL Server

|||

i didn't get the server name. i put my dbi.3Essentials.com as server name but it still showing the same error which i have already given u.

|||

smarty,

Did you go through all the steps that I gave you? If not, how far did you get?

Monday, March 12, 2012

Problem of Parent-Child package with ASP.Net

I have an ASP.NET application that calls a SSIS package. The SSIS package internally calls some other child packages. I observed that sometimes some child pacakges are not even called by the parent. and the behaviour is very indeterminate. sometimes they work fine. sometimes they don't. There is no clue available for this behaviour when the pacakges are not executed. (One general observation is that the memory consumption is very high. but that is the case always.)

I have enabled logging on all child packages. The log is not updated at all when the child packages failed to execute. i.e. the package execution does not start.

Could somebody explain why this is happening? any suggestions/ similar experiences?

Regards

Saurabh

One more observation: if i run the same parent package as a stand-alone. (i.e. not through the asp.net application) it always executes fine. it calls all the child packages very well always. what is different in the asp.net context?