Click here to Skip to main content
15,902,635 members
Home / Discussions / C#
   

C#

 
GeneralGDI+ Pin
rob6446431-Oct-03 5:47
rob6446431-Oct-03 5:47 
GeneralRe: GDI+ Pin
J. Dunlap31-Oct-03 9:30
J. Dunlap31-Oct-03 9:30 
Generalsetup and deployment with MDB files Pin
Anonymous31-Oct-03 5:14
Anonymous31-Oct-03 5:14 
GeneralRe: setup and deployment with MDB files Pin
Heath Stewart31-Oct-03 5:28
protectorHeath Stewart31-Oct-03 5:28 
GeneralRe: setup and deployment with MDB files Pin
31-Oct-03 6:31
suss31-Oct-03 6:31 
GeneralRe: setup and deployment with MDB files Pin
Member 44190931-Oct-03 6:52
Member 44190931-Oct-03 6:52 
Generalwindows service and SQL related problem Pin
rishikt31-Oct-03 3:50
rishikt31-Oct-03 3:50 
GeneralRe: windows service and SQL related problem Pin
Heath Stewart31-Oct-03 4:42
protectorHeath Stewart31-Oct-03 4:42 
1. If you're connecting only to SQL Server and not any other DB systems, use the System.Data.SqlClient instead of OLE DB. These are classes written specifically for SQL Server with a lot of optimizations and additional features over OLE DB.

2. The problem seems to be security. When you put it in a Windows app, it runs under your user credentials (be default). If you are using SSPI to connect to the SQL Server with a trusted connection, your credentials are authenticated and authorized by SQL Server, so you're app can access it.

Typically, most Windows Services use the LocalSystem account. If your connection string is using SSPI and the LocalSystem (SYSTEM) account is NOT added to SQL Server as a viable user that can access the system, you'll get Access Denied.

You should either use a fixed User ID and Password in the connection string, as well as Trusted Connection. Or, continue to use Integrated Security=SSPI and add the SYSTEM account to SQL Server for that database and grant it the rights necessary to run (I wouldn't recommend making it a dbo, though).

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: windows service and SQL related problem Pin
Terry Denham31-Oct-03 5:25
Terry Denham31-Oct-03 5:25 
GeneralRe: windows service and SQL related problem Pin
Blake Coverett31-Oct-03 7:36
Blake Coverett31-Oct-03 7:36 
Generalmulti thread question Pin
rod termaat31-Oct-03 3:38
rod termaat31-Oct-03 3:38 
GeneralRe: multi thread question Pin
Heath Stewart31-Oct-03 4:35
protectorHeath Stewart31-Oct-03 4:35 
GeneralRe: multi thread question Pin
Blake Coverett31-Oct-03 8:04
Blake Coverett31-Oct-03 8:04 
GeneralCOM Interop - objects cause NullReferenceExceptions at random Pin
Corinna John31-Oct-03 2:39
Corinna John31-Oct-03 2:39 
GeneralRe: COM Interop - objects cause NullReferenceExceptions at random Pin
Heath Stewart31-Oct-03 5:22
protectorHeath Stewart31-Oct-03 5:22 
Generalnoob winform question Pin
R. Thomas31-Oct-03 1:37
R. Thomas31-Oct-03 1:37 
GeneralRe: noob winform question Pin
Daniel Turini31-Oct-03 2:20
Daniel Turini31-Oct-03 2:20 
GeneralRe: noob winform question Pin
R. Thomas31-Oct-03 4:08
R. Thomas31-Oct-03 4:08 
General(null) values in datagrid Pin
misiek31-Oct-03 0:30
misiek31-Oct-03 0:30 
GeneralRe: (null) values in datagrid Pin
Daniel Turini31-Oct-03 2:18
Daniel Turini31-Oct-03 2:18 
GeneralRe: (null) values in datagrid Pin
misiek31-Oct-03 2:59
misiek31-Oct-03 2:59 
GeneralRe: (null) values in datagrid Pin
Braulio Dez31-Oct-03 2:59
Braulio Dez31-Oct-03 2:59 
GeneralCrystal Export to Excel Pin
akorolev1030-Oct-03 20:17
akorolev1030-Oct-03 20:17 
GeneralWritng objects to file Pin
Itanium30-Oct-03 18:34
Itanium30-Oct-03 18:34 
GeneralRe: Writng objects to file Pin
MKlucher30-Oct-03 19:08
MKlucher30-Oct-03 19:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.