Re: running stored procedure
Quote:
I keep having errors when I run my code in debug mode.
Tell us what the errors are and which line they are thrown on and we might be able to help ;)
Re: running stored procedure
there's no username or password in your connection string? you can also remove the "&" between the 2 parts of the connection string. They can be combined.
www.connectionstrings.com
Re: running stored procedure
You dont have to use a username and password when you use Integrated Security because it means that it uses Windows Authentication (ie uses your logged on user credentials).
I'm also pretty sure you dont need the \\ when specifying the server, but you will definitely need the \SQLEXPRESS bit if it is a default setup of SQL Express on the server. Its pretty hard to suggest things though when we dont know where it is failing - I mean it might be connecting to the server fine, just throwing an error when he tries to do ExecuteNonQuery
Re: running stored procedure
I apologize for not providing needed information, like I said I'm a newb.
I get an SQLException was unhandled -- error 25
when it hits the line
CONN.Open()
Re: running stored procedure
OK, I took off the preceeding "\\" before the server name.
"Now i get a SQLException error was unhandled" message at the same line, but is says that the user is not associated with a trusted SQL server connection.
I am a domain admin, server admin, sql admin, local workstation admin.
So the error changed slightly, but the code still hangs at the same line.
Re: running stored procedure
Are you 100% sure that your windows user account that you are logged on with actually has permission to access that SQL database though? Just because you are a domain admin doesnt necessarily mean you have permission to every single database within an SQL instance. Also, assuming this application is going to be for more people than just yourself to use, have you thought about if they are going to have permission to the database as well?
Just to test to see if it is a permissions issue, see if you can log in to the SQL instance via SQL Management Studio using your windows credentials.
Re: running stored procedure
Yes sir. I assure you that I can log into the database with my credentials. I can also browse through server objects from my client PC that is running VB using the Server Explorer. I have also checked the firewalls
Re: running stored procedure
Hmm ok well just try this code exactly as it is and see if you still get an exception on the call to CONN.Open()
Code:
Dim CONN As New SqlConnection("Server=MIS631\SQLEXPRESS; Database=AdminGUI; Trusted_Connection=True;")
CONN.Open()
Re: running stored procedure
THAT DID IT!!
Thanks so much. I have never used VB before and my first attempt is for an application that I am making for my Masters project. I am basically writing a new interface for AD Users and Computers, it is a very grandiose attempt for my first time programming.
THANKS SO MUCH!!