Interview Question in SQL Server Security
Interview Question :: Unable to connect to PUBS database
Whenever I try to connect to the PUBS.MDF database, a login failed error message will appear.
I defined the connection string in the web.config file under the connectionstrings section like this:
[code]
add name="Pubs" connectionString="Data Source = localhost\SQLEXPRESS; Initial Catalog=Pubs;Integrated Security=SSPI"
[/code]
And setup the connection in the click event of a button:
[code]
Dim connectionString As String = WebConfigurationManager.ConnectionString...
Dim myConnection As New SqlConnection(connectionString)
myConnection.Open()
..........
[/code]
And I put the PUBS.MDF file in the same folder as the vb source files.
How do I connect to the database correctly?
I am using VStudio 2005 and SQL Server Express 2005.

Loading ...