The error when i run the web application is this:
Did i miss something here? And i dont know where did i get the username "TRANSLTR/ASPNET". Save me please!
I have a button which when i click it it will retrieve data from CorporateDB database. The code of my connection is thisCannot open database "CorporateDB" requested by the login. The login failed. Login failed for user 'TRANSLTR\ASPNET'.
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
Last edited by a moderator: