1

I have to deploy ASP.Net application with remote database connection in IIS server.

Deployment has worked fine without database. And I was able to run that application on the IIS server.

Coming to the application with remote database I have given the connection string in C# code. And it is connected.

My web.config has thsi connection string :

<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
        connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
        providerName="System.Data.SqlClient" />
  </connectionStrings>

I have replaced that with my database connection credentials as follows:

<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="Data Source=RemoteHost,1433;Initial Catalog=DBNAME;user Id=MyUserId;Password=MyPassword"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

In Package/Publish options I have selected (Import from web.config) and deployed that. Then I got the following error:

Web deployment task failed.(Object of type 'dbFullSql' and path 'Data "Data Source=RemoteHost,1433;Initial Catalog=DBNAME;user Id=MyUserId;Password=MyPassword" cannot be created.)

Object of type 'dbFullSql' and path "Data Source=RemoteHost,1433;Initial Catalog=DBNAME;user Id=MyUserId;Password=MyPassword" cannot be created.

The source is invalid.
Script failed for Database 'DBNAME'.
Script failed for Database 'DBNAME'.
Index was outside the bounds of the array.

I am new to ASP.Net. Anybody please help me.

Thank you in advance

3
  • did you see your connection string in IIS is the same in VS? Commented Jan 12, 2013 at 12:35
  • I want to deploy to the IIs in my own PC. The DB is the same for both the servers. And In Package/Publish options of SQL i don't have specified any destination connection string. First i tried to Build the deployment package and it is failed. Commented Jan 12, 2013 at 12:53
  • ok I post the Walkthrough link for help Commented Jan 12, 2013 at 12:55

1 Answer 1

2

I think you didn't configure Web deployment package correct you can do that right Click on Project ,Select Properties and go to package/Publish SQL I have add link for Walkthrough: Deploying a Web Application Project Using a Web Deployment Package (Part 1 of 4) for VS2010 http://msdn.microsoft.com/en-us/library/dd483479(v=vs.100).aspx

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your reply. I don't have SQL in my system. I am connecting to a remote sql server. Is it possible to create a DataBase in that system from my system as destination database..? R is it possible to use the same database for both source and destination..?
yes. you can but really becaous i don't use remote sql server. I don't know how. just read the Walkthrough it will give you Answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.