How to connect a login form in windows application to remote server...????
Hi Everyone,
I am having trouble in creating a login form in my windows application.
If i create a login form with its database local to the system ,it works fine .
But my requirement is that the database is placed on a remote server so that the login is secured.:)
When the user tries to use the application he first needs to login.
When he puts the username and password in the login form it should send the data to a remote server for authentication.
Please help me how to do the needful.:(
Thanks in advance
Regards
Aryan
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.
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
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.
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 ???
Re: How to connect a login form in windows application to remote server...????
That second option says:
Quote:
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?
Re: How to connect a login form in windows application to remote server...????
Hi
Yes you are absolutely right ....second option is used when the database file is on the local system...I have always used this to connect a database to the windows application.
But while using this string we provide the the name of the server i.e .\SQLExpress
In case of remote server we are just providing the IP and port ...not the name of the server .....:confused:
that means we need to configure DSN on the server ???? Like we do in Java Servlets ?????:confused:
And also i don't know what is Network Library for in this String ????:(
Regards
Aryan
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.
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
Re: How to connect a login form in windows application to remote server...????
Try it for yourself and see.
Re: How to connect a login form in windows application to remote server...????
Hi jmcilhinney..
I tried to connect using this string
Data Source=180.215.177.34,1433\SQLExpress;Network Library=DBMSSOCN;Database=login; Trusted_Connection=Yes
Was getting an error message....:(
I even followed steps mentioned on this page
http://support.microsoft.com/kb/914277#method3
But still getting the same error...Please help me...:(:(
Regards
Aryan
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?
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....:(