• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Running a Stored Procedure

Hi guys,

I am after what should be a simple enough task, but baffles me...

I want to be able to run a stored procedure which is located in SQL Server 2000. I don't need any of the information returned to me, I merely need to run the procedure.

Also, I don't want to have to re-enter the username and password for the server, everytime the application is run, I want it all to be stored inside the application.

Thanks guys!
  • 2
  • 2
1 Solution
to run a stored procedure:

using(SqlConnection conn = new SqlConnection({connection string}))
    SqlCommand command = new SqlCommand("MyStoredProc",conn);

2 options for not entering in user name:

1) store the username and password in the connection string in the app.config file

2) use Windows authentication
Cyber-DrugsAuthor Commented:

Thanks for the reply, sorry, but I forgot to mention that I am using Visual Studio 2005, has the app.config been renamed, or am I just being a bit slow?

It's just not added by default.  You can add one to the project.  Also, you could open up the project Settings and add it there.
Cyber-DrugsAuthor Commented:
Perfect, cheers! :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now