Solved

Design Issue with Database Access

Posted on 2006-07-19
1
201 Views
Last Modified: 2010-04-23
Hi

I have a database that can be accessed at any point in time to retrieve data. The database also periodically gets updated with information from a text file that the program imports.

Is there any nice way to restrict access to the database while the database is been updated and make any other requests wait until it has finished?

Thanks
Adam
0
Comment
Question by:adam_pedley
1 Comment
 
LVL 6

Accepted Solution

by:
Nandakumar Sakthivel earned 500 total points
ID: 17136863

If you want to stop accessing the Tables for the particular table means you can acheive this by using transaction objects
using  "SqlCon.BeginTransaction(IsolationLevel.RepeatableRead)"


       Dim sqlCmd As SqlCommand
       Dim SqlCon As SqlConnection
       Dim trans As SqlTransaction

            SqlCon = New SqlConnection("")
            SqlCon.Open()
            sqlCmd = New SqlCommand
            trans = SqlCon.BeginTransaction(IsolationLevel.RepeatableRead)
            sqlCmd.CommandTimeout = 0
            sqlCmd.Connection() = SqlCon
            sqlCmd.CommandType = CommandType.Text
            sqlCmd.Transaction = trans
     
It is a way called pessimistic locking

http://builder.com.com/5100-6388-1049842.html

Thanks,
Nanda
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now