|
-
May 3rd, 2012, 10:03 PM
#1
Thread Starter
New Member
-
May 3rd, 2012, 10:20 PM
#2
Re: How to connect a login form in windows application to remote server...????
So basically you don't know how to connect to the database, right? A query is a query, whether it's for the purpose of logging in or whatever. I suggest that you visit www.connectionstrings.com and check out the appropriate connection string format for your database.
-
May 3rd, 2012, 11:17 PM
#3
Thread Starter
New Member
Re: How to connect a login form in windows application to remote server...????
Hi jmcilhinney,
Thanks for your reply.
If in a windows application the database and the application are in the same PC...in that case I know how to connect to database but my problem is that if the database is on a remote server or say a different PC and your application is on a different PC ..than I don't have an idea what should be the connection string. 
Regards
Aryan
-
May 3rd, 2012, 11:22 PM
#4
Re: How to connect a login form in windows application to remote server...????
That would explain why I directed you to a site that will show you what the connection string would be.
-
May 3rd, 2012, 11:31 PM
#5
Thread Starter
New Member
Re: How to connect a login form in windows application to remote server...????
Hi
I had seen that website before also..
I am confused between two connection strings ....
1 ) Connect via an IP address :
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
2) Attach a database file on connect to a local SQL Server Express instance :
Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;
I mean i am using SQL server 2005 express edition Please explain me how to host the database on the server ...
Do i need to configure the DSN ???
-
May 3rd, 2012, 11:45 PM
#6
Re: How to connect a login form in windows application to remote server...????
That second option says:
Attach a database file on connect to a local SQL Server Express instance
You specifically stated that the database will be on a remote system, not the local system, so how can that even be in consideration?
-
May 4th, 2012, 12:12 AM
#7
Thread Starter
New Member
-
May 4th, 2012, 12:32 AM
#8
Re: How to connect a login form in windows application to remote server...????
This:is of the standard form "MachineName\InstanceName". In this case and many others, the dot stands for the local machine, so that you don't have to change the value as you move from machine to machine. In SQL Server parlance that is equivalent to:or you can specify the local machine explicitly, which, in my case, would look like this:If you want to use an instance on a different machine on the same network then you simply provide the name of that machine instead of the local one.
-
May 4th, 2012, 01:58 AM
#9
Thread Starter
New Member
Re: How to connect a login form in windows application to remote server...????
Hi
Thanks for your instant replies...
....If I understood you correctly ....in my case i can replace the name by the IP of the remote server ??? right ????
Regards
Aryan
-
May 4th, 2012, 02:07 AM
#10
Re: How to connect a login form in windows application to remote server...????
Try it for yourself and see.
-
May 4th, 2012, 08:50 AM
#11
Thread Starter
New Member
-
May 4th, 2012, 10:07 AM
#12
Re: How to connect a login form in windows application to remote server...????
Are you actually connecting over the internet or are the machines on the same LAN? If over the internet, is the instance configured to allow TCP connections?
-
May 4th, 2012, 11:38 AM
#13
Thread Starter
New Member
Re: How to connect a login form in windows application to remote server...????
Hi
Yes i am connecting through Internet ......Machines are not on the same LAN.
I have already configured instance to allow TCP connection ...I have configured according to the steps given on this page...http://support.microsoft.com/kb/914277#method3
and
http://blog.sqlauthority.com/2009/05...-server-error/
but still getting the same error....
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|