helenasmith

New Member
Joined
May 19, 2015
Messages
1
I am new to uploading websites online, I have uploaded my website to ASPHostPortal and run perfectly but i don't know how to connect my MS Sql Data base and how to configure my connection string !

Can any one help me or give me a tutorial of how doing this starting from a normal MS sql Database with normal connection string (Local DB and Local connection string) until uploading it online ?

Can you describe me step by step to connect my MS Sql Data base and configure my connection string or give me link to learn it ?
 

Solution
To connect your MS SQL Database and configure your connection string for an ASP.NET website hosted on ASPHostPortal, you can follow the steps below:
  1. Database Creation:
    • Log in to your ASPHostPortal hosting account and access your hosting account control panel.
    • Look for the database section and proceed to create a new MS SQL database. This usually involves specifying a database name, username, and password, and granting necessary permissions.
    • After creating the database, note down the database name, username, password, and server details provided by ASPHostPortal.
  2. Connection String Configuration:
    • In your ASP.NET application, locate the web.config file.
    • Add a connection string within the...
To connect your MS SQL Database and configure your connection string for an ASP.NET website hosted on ASPHostPortal, you can follow the steps below:
  1. Database Creation:
    • Log in to your ASPHostPortal hosting account and access your hosting account control panel.
    • Look for the database section and proceed to create a new MS SQL database. This usually involves specifying a database name, username, and password, and granting necessary permissions.
    • After creating the database, note down the database name, username, password, and server details provided by ASPHostPortal.
  2. Connection String Configuration:
    • In your ASP.NET application, locate the web.config file.
    • Add a connection string within the section. Here's a sample connection string format:
      Code:
      xml
      • Replace the placeholders with the actual server, database, username, and password details provided by ASPHostPortal.
    • Database Access Code:
      • In your ASP.NET application code, you can then reference the connection string using the ConfigurationManager.ConnectionStrings["MyDbConnection"].ConnectionString method.
      • You can then use ADO.NET or Entity Framework to establish connections and interact with the database using this connection string.
    • Testing the Connection:
      • Run your application locally in debug mode. Ensure it can establish a connection with the database using the configured connection string.
      • Check for any connection errors and make sure the data access functionalities work as expected.
    • Deployment:
      • Once the connection is verified locally, publish your ASP.NET application to ASPHostPortal using a hosting manager or deployment tool.
      • Update the connection string in the web.config file to match the production database details provided by ASPHostPortal. By following these steps, you should be able to connect your MS SQL Database and configure the connection string for your ASP.NET website hosted on ASPHostPortal.
 

Solution
Back
Top