The code below should be sufficient for you to make a connection to your MSSQL database:
Note:Ensure you specify the correct host name (Data Source parameter) for the service your site is hosted on:
- Namesco Ireland shared hosting - mssql.reg365.net
- Namesco UK shared hosting - mssql.namesco.net
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
sub Page_Load
dim dbconn
dbconn=New SqlConnection("Data Source=mssql.namesco.net;Database=dbname;User
ID=username;Password=password")
dbconn.Open()
end sub
</script>Replace dbname,username and password with the appropriate details for your database.

