HI,
I am copying some code from another uses software to my project and i am quite new in vb.net
from the user code, the connection string is :
BCon = New sqlConnection("data source=micron;uid=sa;pwd=a
dmin;initi
al catalog=gsmlanka")
cartCon = New sqlConnection("data source=micron;uid=sa;pwd=a
dmin;initi
al catalog=gsmlanka")
I can see, he used sql server username and password for his development
but in my pc , i am using sqlserver but windows authentication
I am trying with bellow code but its not working :
BCon = New sqlConnection("Data Source=GRAPHICS\sqlexpress
;initial catalog=gsmlanka;Integrate
d Security=True")
cartCon = New sqlConnection("Data Source=GRAPHICS\sqlexpress
;initial catalog=gsmlanka;Integrate
d Security=True")
Error is below :
Cannot open database "gsmlanka" requested by the login. The login failed.
Login failed for user 'GRAPHICS\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
xception: Cannot open database "gsmlanka" requested by the login. The login failed.
Login failed for user 'GRAPHICS\ASPNET'.
Do i need to give some permission ?
but its not working , can any one tell me where i am doing wrong?
Start Free Trial