G
Guest
Hi,
I have an windows forms application that accesses a SQL database
I have a few questions as to connecting to the database.
This application will run 24 hours a day. It is a monitoring application and
will store events that happen in the database (These events happen randomly
without pattern, between 10-50 a day) .
There are a number of situations where the database is accessed.
1. Configure the system at start before system is starts monitoring
2. At Random times when events occured.
3. When user want to generate a report of event occured during
Specified time period.
4. System uses configuration data inputted in 1. throughout system
operation
I was wondering what is the most efficient methods to control access to the
database for the above scenarios.
How many connection strings should i use. When should i open and close these
connections?
For 1., should i do this in a disconnected manner? Open connection, get
local copy of config data, update config data then synchronise changes with
database? Or should i open a direct connection to database do changes
directly and then close database?
What are pros and cons of both methods?
For point 2. I assume the best way to update the database is to open a
connection and update databse directly rather than doing it through
disconneted DataSet?
Also i was wondering if i should leave the database connection open always
rather than opening and closing for each event that takes place?
Would this be inefficent?
For point 3, should i use a separate connection string for this access and
is the connected or disconnected model best for this?
For Point 4, i was thinking of utilising the same connection string as used
in point 2 as the system accesses the database randomly for theses 2 points.
I'd appreciate any comments or advice,
Thanks In Advance
Macca
I have an windows forms application that accesses a SQL database
I have a few questions as to connecting to the database.
This application will run 24 hours a day. It is a monitoring application and
will store events that happen in the database (These events happen randomly
without pattern, between 10-50 a day) .
There are a number of situations where the database is accessed.
1. Configure the system at start before system is starts monitoring
2. At Random times when events occured.
3. When user want to generate a report of event occured during
Specified time period.
4. System uses configuration data inputted in 1. throughout system
operation
I was wondering what is the most efficient methods to control access to the
database for the above scenarios.
How many connection strings should i use. When should i open and close these
connections?
For 1., should i do this in a disconnected manner? Open connection, get
local copy of config data, update config data then synchronise changes with
database? Or should i open a direct connection to database do changes
directly and then close database?
What are pros and cons of both methods?
For point 2. I assume the best way to update the database is to open a
connection and update databse directly rather than doing it through
disconneted DataSet?
Also i was wondering if i should leave the database connection open always
rather than opening and closing for each event that takes place?
Would this be inefficent?
For point 3, should i use a separate connection string for this access and
is the connected or disconnected model best for this?
For Point 4, i was thinking of utilising the same connection string as used
in point 2 as the system accesses the database randomly for theses 2 points.
I'd appreciate any comments or advice,
Thanks In Advance
Macca