Moving ASP.net application from home to server

asp.net New Zealand
  • 14 years ago

    Currently I am doing a project at home. I got ms sql server 2005 and vs.net 2005 installed on my home computer. I am just wondering if the application is going to work after it is moved to a server in the future. I am worried about the connection between the application and the database since I am using the "SqlDataSource" control provided in VS 2005 to interact with database.

    Anybody help me out please. Thank you so much. 

  • 14 years ago

    Generally machine specific constants refrenced alot in code are best kept in the web.config file in the connectionStrings section. This is so you can just change these according to what machine the application is running on and they are used across the site.

    You have to be mindfull not to hard code things like file paths, server names, DB conn's etc. If you can't get them dynamically in code at run time, don't hard code them - put them in the web.config and refrence them like - System.Configuration.ConfigurationManager.ConnectionStrings("theName")connectionString.

    Have a look at where the sqlDataSource DataBase connectionString is located. if it is hard coded in the vb or c# page then you want to move it to the web.config file and refrence it from there. I would gess that VS 2005 would give you the option of getting them from the web.config file.

    Regards

    Brin

  • 14 years ago

    Thanks for your message Brin.

    I am a junior, just started to learn ASP.net. Can you please give me a specific example, if you do not mind? Thanks

  • 14 years ago

    hi..

    u can use the web.config file to make the connection string to database.. so that it reduces the effort to make the connection string..

    if u've used the "SqlDataSource" then rebuild it..

    With Thanks.,

    R.Chezhian.,

  • 14 years ago

    If you are using sql server express, check that your hosting provider has this enableda dn you can use this datasource as some are saying that there are some security issues surrounding sql server express in a hosted environment. i know this is the case with fasthosts in the uk.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are only 3 numbers of interest to a computer scientist: 1, 0 and infinity”