Click here to Skip to main content
15,887,850 members
Home / Discussions / C#
   

C#

 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:25
MemberDotNetting11-Mar-12 6:25 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 6:47
mveOriginalGriff11-Mar-12 6:47 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:50
MemberDotNetting11-Mar-12 6:50 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 6:54
mveOriginalGriff11-Mar-12 6:54 
QuestionSimeple Service Not Working Pin
AmbiguousName11-Mar-12 2:51
AmbiguousName11-Mar-12 2:51 
AnswerRe: Simeple Service Not Working Pin
PIEBALDconsult11-Mar-12 3:36
mvePIEBALDconsult11-Mar-12 3:36 
AnswerRe: Simeple Service Not Working Pin
AmbiguousName11-Mar-12 5:49
AmbiguousName11-Mar-12 5:49 
GeneralRe: Simeple Service Not Working Pin
Dave Kreskowiak11-Mar-12 10:20
mveDave Kreskowiak11-Mar-12 10:20 
It doesn't work because you're using a connection string that uses the current credentials to login to SQL Server. That only works IF:

1) Windows Authentication is turned on in SQL Server.

2) The code is running under an account that the SQL Server trusts.

Your problem is your service is running under LocalSystem by default, which SQL Server does NOT trust.

There are 2 solutions to this. The first is to create a user in SQL Server and assign it's permissions properly to access the database in questions, then modify the connection string in your code to use the account and NOT use Integrated Security.

The second is to change the account that your service is running under, to something like YOUR account. Start->Run->Services.msc. Find your service, then right-click on it and click Properties. Click the LogOn tab and it should be pretty obvious from there.

In the future, you might want to learn WHY those things are listed in the connection string and figure out what each option does.

QuestionHow to Format a string in c# Pin
Arunkumar.Koloth11-Mar-12 0:48
Arunkumar.Koloth11-Mar-12 0:48 
AnswerRe: How to Format a string in c# Pin
André Kraak11-Mar-12 0:55
André Kraak11-Mar-12 0:55 
GeneralRe: How to Format a string in c# Pin
ProEnggSoft11-Mar-12 2:54
ProEnggSoft11-Mar-12 2:54 
AnswerRe: How to Format a string in c# Pin
OriginalGriff11-Mar-12 1:43
mveOriginalGriff11-Mar-12 1:43 
GeneralRe: How to Format a string in c# Pin
Arunkumar.Koloth11-Mar-12 17:30
Arunkumar.Koloth11-Mar-12 17:30 
GeneralRe: How to Format a string in c# Pin
Marcus_212-Mar-12 5:28
Marcus_212-Mar-12 5:28 
GeneralRe: How to Format a string in c# Pin
Arunkumar.Koloth13-Mar-12 4:37
Arunkumar.Koloth13-Mar-12 4:37 
GeneralRe: How to Format a string in c# Pin
Marcus_213-Mar-12 5:43
Marcus_213-Mar-12 5:43 
GeneralRe: How to Format a string in c# Pin
Arunkumar.Koloth14-Mar-12 4:18
Arunkumar.Koloth14-Mar-12 4:18 
Questionweb link manipulation Pin
james bradbery10-Mar-12 18:29
james bradbery10-Mar-12 18:29 
AnswerRe: web link manipulation Pin
ProEnggSoft10-Mar-12 19:28
ProEnggSoft10-Mar-12 19:28 
GeneralRe: web link manipulation Pin
james bradbery10-Mar-12 19:50
james bradbery10-Mar-12 19:50 
GeneralRe: web link manipulation Pin
Richard MacCutchan10-Mar-12 23:54
mveRichard MacCutchan10-Mar-12 23:54 
GeneralRe: web link manipulation Pin
ProEnggSoft11-Mar-12 0:26
ProEnggSoft11-Mar-12 0:26 
GeneralRe: web link manipulation Pin
Richard MacCutchan11-Mar-12 0:31
mveRichard MacCutchan11-Mar-12 0:31 
AnswerRe: web link manipulation Pin
L Viljoen10-Mar-12 21:41
professionalL Viljoen10-Mar-12 21:41 
QuestionReload Form1 when Form2 ShowDialog like? Pin
nhanlaptrinh10-Mar-12 17:14
nhanlaptrinh10-Mar-12 17:14 

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.