April 19, 2009 at 10:21 pm
Hi all. I am attempting to connect to a remote SQL Server using the SqlConnection object, but SQL Server rejects all attempts. I know it has something to do with the user ID I'm attempting it with, but I don't know how to get around it. First of all, my ID on my primary network is AAD09; my ID on the remote server is upits\admAnderson ... huge disconnect right there. We're not using mixed-mode security, nor are there individual accounts for users on SQL Server itself; that leaves me with using Integrated Security.
So, my question is this: what steps do I need to execute before I can successfully execute a series of statements along the line of:
using (SqlConnection conn = new SqlConnection(...))
{
conn.Open();
...
...
}
I'm almost certain I have to do something to let it knowI have a legitimate right to access the server and thus be able to access SQL Server using Integrated Security, but I don't have a clue as to what that might be.
Any help will be greatly appreciated.
April 21, 2009 at 10:38 am
Look at the parameters for instantiating your SqlConnection. You either need to pass the connection string here or set it after you instantiate it.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 21, 2009 at 12:24 pm
Please post the connection string you are using. Are you doing a desktop application or a web application?
Check out http://www.connectionstrings.com/ for connection string syntax and arguments.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy