Connect SQL server from remote pc
1. share your database on LAN/WAN
2. set new connection string in exe/text file [where sql connection string is written]
step 1: follow steps given in this link [For access sql database remotely(from different pcs)]
http://support.microsoft.com/kb/914277[^]
step 2: after step 1 complete then change connection string's parameters,
datasource = server-name OR IP-Address [which is in sharing now after step 1] ;
Initial catalog = your database name ;
UserId = sql server - user login Id ;
Password = sql server - user login password;
If error comes (err No: 18456) - can not connect from remote pc User not found in Domain
Reason : UserLock out (state-1)
sql server does not contain loginName like this...
this username(e.g. sa) is not created inside this server-name
Solution : create New Login in sql server-(With SQL authentication Mode)
Create New SQL Server Authenticate user login
sql -> object explorer ->security -> logins-> new login->
in new window
general tab-> Login name : abcd
check 'Sql server authentication'
Pwd =*** , confirm pwd=***
check 'Enforce pwd policy'
DO NOT check 'Enforce pwd expiration' (if check it will cause err: 18515)
Ok.
.
.
.
now, try to login
.
If err comes (err No: 18452)
solution : For sql 2000
start -> Program -> sql server -> enterprise Manager ->
server name -> properties ->security under authentication,
check 'Sql server & Windows'
For sql 2005
sql -> servernm -> properties -> security ->
check 'Sql server & window Authentication mode'
Note: stop sql server & Agent services then start both services again.
Now disconnect sql server & connect again you will also able to Login through sql-authentication
Happy Coding!
:)