DT sawant
DT sawant

Reputation: 1221

SQLITE - Storing predefined Queries outside code in WPF application

I have WPF application where there are some predefined SQL queries.I want to run these queries sequentially in one go, but I don't want to hard code these queries into C# code.Please give me some suggestions about where to store these queries and access it to my C# code.

Upvotes: 2

Views: 150

Answers (2)

DT sawant
DT sawant

Reputation: 1221

I am using CSV file as a resource file in which I have written all my SQL queries.I am reading CSV file in my code. It helped me to keep my queries separated from my C# code.

Upvotes: 0

rajibdotnet
rajibdotnet

Reputation: 1596

As @ken2k suggested, bundle all your queries in a stored procedure. You don't have to hard-code anything but provide the stored procedure name. This is a very flexible approach as you don't have to make any code changes in C# if you need to change your queries.

Upvotes: 1

Related Questions