Solved

Design Issue with Database Access

Posted on 2006-07-19
1
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal reports login after closing form 3 57
VB.NET Inline If statement 4 58
Filtering a datagrid view 8 46
XML and Linq - reading fields in repeating nodes 3 26
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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