How to connect to SQL Server via Win Auth?

B

brett

I get a "SQL Server does not exist or access denied" when I try to
connect to my local sql server. Here's my code:


SqlConnection conn = new SqlConnection("Integrated Security=True;
Database=NorthWind; Server=local");
SqlCommand cmd = new SqlCommand("Select * from categories", conn);
conn.Open();

I can connect fine through EM. I've read sometimes ASPNET account may
need to be added to something. Please provide some details or any
suggestions.

Thanks,
Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
BrentonMcc
Top