I've made the SQL Server database, created tables, and using the same tables i've created a basic application for my project using localhost SQL Server installation. Now I'd like to connect it to web SQL Server located at Godaddy. Following is the script am using to connect to the web database, it works fine with localhost but doesn't connect to Godaddy SQL Server. Kindly guide. Am using ASP.NET C# as you can see below. var con2 = new SqlConnection("Data Source=p3nmssqladmin.secureserver.net;Initial Catalog=dbname;User Id=user;Password=pass;"); var com2 = new SqlCommand { Connection = con2 }; var queryString2 = String.Format("insert into GPS values ({0},{1},{2},default)", id, lat, lon); com2.CommandText = queryString2; try { con2.Open(); com2.ExecuteNonQuery(); xlblError.Text = "Success"; } catch (Exception exp) { xlblError.Text = exp.Message; }
GoDaddy do not allow remote connections I have hosting with them and dba is a nightmare. GoDaddy also dont allow out remote connections. Upload your application via ftp, then run it live and it will connect to your db.
Just found out that you can actually allow remote connections. You have to enable the feature though when you are creating the DB. This works for both MS SQL and MySQL.