Problem with SQL Server Login

the_atom

Active member
Joined
Apr 18, 2007
Messages
26
Programming Experience
Beginner
The error when i run the web application is this:

Cannot open database "CorporateDB" requested by the login. The login failed. Login failed for user 'TRANSLTR\ASPNET'.
I have a button which when i click it it will retrieve data from CorporateDB database. The code of my connection is this

VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 
Dim sqlConnect As New SqlConnection("integrated security=SSPI;data source=(local)\SQLEXPRESS;persist security info=False;initial catalog = CorporateDB;")
Try
sqlConnect.Open()
Catch ex As Exception
 
End Try
Dim emp_data As String
Dim sqlString As String = "SELECT id FROM emp_table WHERE EmployeeID = " & "'" & TextBox1.Text & "'"
Dim objCommand As New SqlCommand(sqlString, sqlConnect)
 
Dim MyDataReader As SqlDataReader
 
MyDataReader = objCommand.ExecuteReader
 
Do While MyDataReader.Read
 
emp_data = (MyDataReader.Item(0))
 
Loop
 
MyDataReader.Close()
sqlConnect.Close()
 
 
 
End Sub
Did i miss something here? And i dont know where did i get the username "TRANSLTR/ASPNET". Save me please!
 
Last edited by a moderator:
Back
Top