Question:
How to access GoDaddy's hosted SQL Server database?
|
Answer:
public class DBBase { public DBBase() { } SqlConnection sqlCon; private string sConStr = "Data Source=whsql-v07.prod.mesa1.secureserver.net;Initial Catalog=yourdatabase;User ID=youruserid;Password=yourpassword;"; protected SqlConnection Get_ConnectionDB() { sqlCon = new SqlConnection(sConStr); return sqlCon; } protected void CloseDB() { if (sqlCon.State != ConnectionState.Closed) { sqlCon.Close(); } } }
|
Need help with XHTML, ASP.NET, C# or SQL-Server? -
Contact Webmaster