storing raw SQL

M

Mark

Previously, all our applications have used stored procedures against SQL
Server for data access. However, we are now hitting an Informix database
and need to pass raw SQL queries.

Where's the best place to store these sometimes lengthy queries? In a
method that returns a single string prefixed by the @ symbol? In an XML
file? In a text file? Something else?

Thanks in advance.

Mark
 
W

Wiktor Zychla

Where's the best place to store these sometimes lengthy queries? In a
method that returns a single string prefixed by the @ symbol? In an XML
file? In a text file? Something else?

put it in a text file and add the text file to the project (set it as
"embedded resource").

then use reflection (Assembly's GetManifestResourceStream for example) to
get the content in the runtime.

regards,
Wiktor Zychla
 

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

Top