 |
|
| .NET DotNet Forum Index » ADO .NET Forum » Connect SQL Server from Windows Forms - Windows... |
|
Page 1 of 1 |
|
| Author |
Message |
| Lubos Hladik... |
Posted: Thu Nov 05, 2009 9:50 am |
|
|
|
Guest
|
Hi,
is there a way how to connect to SQL Server from Windows Forms, when Windows
Authentication Mode is set and client (application) runs on a computer not in
a domain?
Can I use some impersonation? I tried to use LogonUser() from advapi32.dll,
but it doesn't work, when computer is not in a domain :(
Thanks |
|
|
| Back to top |
|
|
|
| William Vaughn (MVP)... |
Posted: Sat Nov 07, 2009 12:06 am |
|
|
|
Guest
|
Set SQL Server to use mixed mode security. Setup a login account and
password. Make sure the selected port and protocol is enabled on the server
and not blocked by firewalls. Make sure the server's name is visible via the
DNS.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
"Lubos Hladik" <LubosHladik at (no spam) discussions.microsoft.com> wrote in message
news:C870749E-65E8-48F5-BE34-59B698E43BA5 at (no spam) microsoft.com...
Quote: Hi,
is there a way how to connect to SQL Server from Windows Forms, when
Windows
Authentication Mode is set and client (application) runs on a computer not
in
a domain?
Can I use some impersonation? I tried to use LogonUser() from
advapi32.dll,
but it doesn't work, when computer is not in a domain :(
Thanks |
|
|
| Back to top |
|
|
|
| CSharpner... |
Posted: Wed Nov 11, 2009 11:40 am |
|
|
|
Guest
|
I would strongly discourage connecting to a remote database directly
from a WinForms application if this application will be deployed to
multiple desktops because this requires putting the connection string
on every client machine that connects to the database. While there /
are/ some things you can do to make it more difficult for malicious
users to see the connection string, you can't stop a determined and
knowledgeable user from getting it.
Instead, I highly recommend exposing all data access via a web
service. Your WinForms application can then call the web service
methods. There are multiple techniques for securing web services too
and many can be implemented on top of each other. Inside the web
service, you can also write more complex security in addition to
everything else you can do with them.
HTH
http://csharpner.blogspot.com
On Nov 7, 12:06 am, "William Vaughn \(MVP\)" <bil... at (no spam) Betav.com> wrote:
Quote: Set SQL Server to use mixed mode security. Setup a login account and
password. Make sure the selected port and protocol is enabled on the server
and not blocked by firewalls. Make sure the server's name is visible via the
DNS.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
"Lubos Hladik" <LubosHla... at (no spam) discussions.microsoft.com> wrote in message
news:C870749E-65E8-48F5-BE34-59B698E43BA5 at (no spam) microsoft.com...
Hi,
is there a way how to connect to SQL Server from Windows Forms, when
Windows
Authentication Mode is set and client (application) runs on a computer not
in
a domain?
Can I use some impersonation? I tried to use LogonUser() from
advapi32.dll,
but it doesn't work, when computer is not in a domain :(
Thanks |
|
|
| Back to top |
|
|
|
|
|
All times are GMT - 5 Hours
The time now is Mon Nov 30, 2009 12:54 pm
|
|