Deploy ASP.Net app

I gave my app to a client. I didnt "package" it. I compiled it and gave them the folder. They installed it on a webserver and only the first page comes up. When the app gets to "dbconnection.open", they get a null-reference.

I added debug steps to the code...thinking maybe the userID is null or maybe the connection string is null but they're not. They can also ping the server that has SQL server on it from the web server...

***Do I need to "package" the app ? I remember in VB6, packaging the app included all the necessary dlls in the package..so if a server doesnt have the dlls..it would get it with the package...

*** what is the dll that sql connection looks for? I have sqlsvr32.dll on my laptop...

Thanks for any help...

LVL 8
CamilliaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VelioCommented:
you don't need to package it if you're using System.Data.SqlClient to connect to the DB, they'll already have it when they installed the .NET framework.

i would check the following:
1. is the connection string valid (you say they can ping the server, but that doesn't necessarily mean they can connect to it), eg check database permissions, sql remote connection settings, protocols etc.
2. is IIS using the same ASP.NET version on the client environment as it is on your dev environment.
0
CamilliaAuthor Commented:
Thanks for answering... finally someone answered ! :)

1."sql remote connection settings"... Do i need "trusted connection =False" or something?

2. "same ASP.Net version".. how can I check this?

 
0
VelioCommented:
well depending on what the SQL Server authentication mechanism is used, you'll have to adjust your connection string - ie if it's using windows authentication, you'll have to add a login to SQL for the aspnet user. but a SQL login error would not normally throw a null-reference exception... do you have more error info and some code?

to check the ASP.NET version you can either open up the IIS configuration (Control Panel > Administrative Tools > IIS) and check in the properties of the app (the ASP.NET tab for IIS6, i think you'll have to look up in the application pool settings for IIS7). Alternatively if your exception isn't caught and you get the generic ASP.NET error screen, the version would appear at the very bottom of the page after the error message details.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jay_eireCommented:
Hi Farzadw,
SQL Connection Issue
Try a simple Telnet to the SQL server address to port 80: e.g: Telnet 123.456.789.10 80 see if there are any error messages coming back.

Im guessing that your app was written for .NET Framework 2.0, check that the virtual directory/application is set to run under the .NET Framework 2.0.

Go to IIS Manager > Right Click On Virtual Directory/Application > Go to the ASP.NET Tab > check ASP.NET Version is set to 2.0

THanks
Jay Eire
0
CamilliaAuthor Commented:
1.They're not using Windows authentication. They're using Login authentication. They created the login/pwd in the database. They say they've made that login a dbo owner. *** I havent checked to make sure what they're saying is correct . I will do that ***

2. I think they have IIS6 and I asked them to make sure the site is 2.0 and not 1.1. Will double check this again

3. Yes, i do have code. I even added debugging to it and gave it to them. It logged to a textfile and what I  suspected that could be null...were not null. My code is below.

4. I dont have "trusted connection" in my webconfig.

**** The "debug" code in "try-finally" didnt get logged in to the textfile. So, dbconnection.open even fails.

*** I'm guessing something related to sql server is missing on their box but i really dont know...
*** The error is this and points to "dbmanager.close". So, it cant even open a connection and it tries to close it..

System.NullReferenceException
Object reference not set to an instance of an object.


 Dim dbManager As IDBManager = New DBManager(WebDAL.Source.UniWeb.Data.Common.DBTools.DBType)
 
            dbManager.ConnectionString = ConfigurationManager.ConnectionStrings("VQDBase").ConnectionString.ToString
 
            ''debug code
            Dim uniFilePath As String = System.Web.HttpContext.Current.Server.MapPath("debug" & Now.Second & ".txt")
            If Not File.Exists(uniFilePath) Then
                Dim fs As FileStream = File.Create(uniFilePath)
                fs.Close()
            End If
 
 
            Dim writer As StreamWriter
            writer = File.AppendText(uniFilePath)
            writer.WriteLine("server selection:" & WebDAL.Source.UniWeb.Data.Common.DBTools.DBType.ToString & " --connection:" & dbManager.ConnectionString)
 
 
 
            writer.WriteLine("userlogin: " & userLogin)
 
            'debug code
 
 
            Try
                dbManager.Open()
 
                 writer.WriteLine("After db open")
 
 
                'add parameters
                dbManager.CreateParameters(1)
                dbManager.AddParameters(0, "@UserLogin", userLogin, ParameterDirection.Input, 10)
 
                dbManager.ExecuteReader(CommandType.StoredProcedure, "usp_UserAccess")
 
                'writer.WriteLine("after calling SP")
 
 
                While (dbManager.DataReader.Read)
 
                    retVal.Add(dbManager.DataReader(0).ToString())
 
 
                End While
 
 
            Catch ex As Exception
              
                Throw (ex)
 
            Finally
                 writer.Close()
                dbManager.CloseReader()
                dbManager.Close()
 
            End Try

Open in new window

0
CamilliaAuthor Commented:
Jay - I just saw your msg. Let me read.
0
CamilliaAuthor Commented:

I dont have acces to their webserver...but i have access to another server and I did a telnet on port80 to the IP address of the webserver and I got an error that cannot connect..

*** I emailed them to try telneting from the webserver themselves. Howcome ping works tho??
0
jay_eireCommented:
Hi Farzadw,
you will need to check the connectivity from the web server where you have deployed your application and telnet to the SQL server from there.

Thanks
Jay
0
CamilliaAuthor Commented:
I emailed the client to do that. Will have to wait until tomorrow.
0
CamilliaAuthor Commented:
Client says they dont need to telnet because the sql-server is not a webserver.  Maybe telnet is not used to test connectivity. I asked him to see if he has a sql server management studio to test connectivitiy.
0
jay_eireCommented:
Have a look at thsi porst - Telnet shoud be against port 1433

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2157033&SiteID=17
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CamilliaAuthor Commented:
thanks..they're on SQL2000..can they still use telnet to test it?
0
CamilliaAuthor Commented:
i guess so...there's a command for it.. thanks
0
CamilliaAuthor Commented:
Thank you both for your help. This is resolved now. I created a "package' in dotnet and that did it. I guess something was missing on their web server.
0
jay_eireCommented:
Excellent news Farzadw.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.