Windows Hosting Database Connection Uganda

<add name="strConn" connectionString="Data Source=localhost;Initial Catalog=DBNAME;Integrated Security=false;User ID=DBUSERNAME;Password=DBPASSWORD" />

In some instances, the "Data Source" will need to have the Instance Name after it(\sqlexpress), such as this:

<add name="strConn" connectionString="Data Source=localhost\sqlexpress;Initial Catalog=DBNAME;Integrated Security=false;User ID=DBUSERNAME;Password=DBPASSWORD" />


DBNAME is what you specified as your database name in the control panel
DBUSERNAME is the username you created to connect to the database (and was associated with the database in the control panel)
DBPASSWORD is the password you associated with the username above

An example script:

<%@ Import Namespace="System.Data.SqlClient" %>
<%
Dim conn As SqlConnection
Dim sqlQuery As SqlCommand
Dim dtrTbl As SqlDataReader
conn = New SqlConnection( "Server=localhost\sqlexpress;uid=USERNAME;pwd=PASSWORD;database=DBID" )
conn.Open()
sqlQuery = New SqlCommand( "Select COLLUMN_NAME From TABLE_NAME", condDBID)
dtrTbl = sqlQuery.ExecuteReader()
While dtrTbl.Read()
Response.Write(œ<li>" )
Response.Write(dtrTbl( "COLUMN_NAME" ) )
End While
dtrTbl.Close()
conn.Close()
%>
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Managing MySQL Databases With PHPMyAdmin Uganda

Let's learn how to Manage MySQL Databases with phpMyAdmin. This tutorial will assume that you are...

How To Create A MySQL Database Uganda

Let's learn how to create a MySQL Database. MySQL Databases allow you to store lots of...

Importing databases and tables with phpMyAdmin Uganda

This tutorial is to teach you how to import databases and tables with phpMyAdmin. We will assume...

Inserting fields into database tables with phpMyAdmin Uganda

This tutorial is going to teach about the program phpMyAdmin, and how to Insert fields into...

Deleting tables in a database with phpMyAdmin Uganda

This tutorial is to teach you about specific operations in phpMyAdmin. We are going to learn how...

Powered by WHMCompleteSolution