By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Embed stored procedures?

P: n/a
I've written some stored procedures that I want to use in my vb.net program.
I know how I can add them to SQL by entering the stored proc as a string and
then use the ExecuteNonQuery command to add them to the SQL server.
However, I was wondering if there was another way to embed them into my vb
project.

I see when I add the .sql file to the project that in the Build Action
options for the file, they are automatically marked as "content". Can I use
something in System.Reflection to enumerate these files, pull them out of
the compiled .exe and then add them the SQL (likely still using
ExecuteNonQuery)?

Thanks,

Chris
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <j_********************@comcast.com>,
ch****@removethis.sirana.com says...
I see when I add the .sql file to the project that in the Build Action
options for the file, they are automatically marked as "content". Can I use
something in System.Reflection to enumerate these files, pull them out of
the compiled .exe and then add them the SQL (likely still using
ExecuteNonQuery)?


Change the build action to "Embedded Resource", then you can use code
similar to this post to pull the stored procs out:

http://tinyurl.com/nfc1

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.