473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Database problems in VB.NET 2003

Hello,

I have following problem and don't know how to solve it.

I have 1 database and multiple connections. Now i want to lock the table
where there is an insert, update or delete statement.

Is there a way to lock a table for Reading/Writing and is is still possible
to have 5 connections on the same database and the same table, just as long
as don't change anything?

Tx

I'm working with SQL SERVER 2005 (free version) and VB.NET 2003
Jan 8 '07 #1
2 937

Kerry Moorman schreef:
thorgal,

Why do you want to lock the table instead of using optimistic concurrency?

Unless you have a really, really unique requirement, optimistic concurrency
is the way to go.

Kerry Moorman

Dear,

Because i don't no what "Optimistic Concurrency" is and what it is and
what it those, can you please explain it to me

Tx

Jan 8 '07 #2
Ok, i have looked at it but i still don't know how to add it in my code, off
course i now what it is but how do I implement it in my code???

Public Shared Function InsertAlgemeen(ByVal oa As clsAlgemeen) As Integer
Dim sSQL As String

sSQL = "spInsertTblAlgemeen"

Dim opar1 As New SqlParameter("@Naam", oa.Naam)

Dim opar2 As New SqlParameter("@AantalCellen", oa.AantalCellen)

Dim opar3 As New SqlParameter("@AantalCentrales", oa.AantalCentrales)

Dim opar4 As New SqlParameter("@PrinterAanwezig", oa.PrinterAanwezig)

Dim opar5 As New SqlParameter("@ResetPLC", oa.ResetPLC)

Dim opar6 As New SqlParameter("@OpstartVertraging", oa.OpstartVertraging)

Dim opar7 As New SqlParameter("@Begindag", oa.Begindag)

Dim opar8 As New SqlParameter("@Einddag", oa.Einddag)

Dim id As Integer

Dim odt As New DataTable

odt = clsDatabase.GetDT(sSQL, opar1, opar2, opar3, opar4, opar5, opar6,
opar7, opar8)

For Each DR As DataRow In odt.Rows

id = IIf(Convert.IsDBNull(DR("ID")), "", DR("ID"))

Next

Return id

End Function

"Kerry Moorman" <Ke**********@discussions.microsoft.comschreef in bericht
news:20**********************************@microsof t.com...
Thorgal,

This is a pretty fundamental concept for any type of database programming.

I suggest starting by looking up concurency in VB 2003's Help.

Then I would use Google to look up the same topic.

Kerry Moorman

"Thorgal" wrote:
>>
Kerry Moorman schreef:
thorgal,

Why do you want to lock the table instead of using optimistic
concurrency?

Unless you have a really, really unique requirement, optimistic
concurrency
is the way to go.

Kerry Moorman


Dear,

Because i don't no what "Optimistic Concurrency" is and what it is and
what it those, can you please explain it to me

Tx


Jan 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cooldv | last post by:
i am running a website on Windows 2000 server with ASP 3 webpages and Access 2000 database. (with a hosting company) traffic is slow at this time but expect to grow. lately i have been reading...
19
by: dchow | last post by:
Our database size is currently 4G and is incrementing at a rate of 45M/day. What is the max size of a SQL database? And what is the size beyond which the server performance will start to go down?
0
by: akmal | last post by:
Final Call for Participation: Monday, 8 September 2003 (prior to VLDB 2003), Humboldt-University Berlin (main building). Invited Talk will be given by Professor Michael Franklin, University of...
2
by: Ausrack Webmaster | last post by:
Nobody got any ideas on the below problem? :-( # psql -V psql (PostgreSQL) 7.0.2 contains readline, history, multibyte support Portions Copyright (c) 1996-2000, PostgreSQL, Inc Portions...
7
by: Andante.in.Blue | last post by:
Hello everyone! I've been working with a problematic legacy database for a while. While I am still fairly new to Access, the more I work with the database, the more problems I've uncovered. ...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
2
by: Jeff | last post by:
Does anyone know of any potential problems running a 2000 database with 2003? Also, what about installing all other Office products as 2003 versions but leaving Access as 2002 running a 2000...
0
by: Mike Knight | last post by:
(I've also posted this problem on microsoft.public.excel.programming) I have a MS Access 2003 Database named "AS400 Fields.mdb". This database contains links to tables on an AS400. In MS...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
6
by: teddysnips | last post by:
I'm having trouble adding Access 2003 databases to Sourcesafe. I go to Tools, Sourcesafe, Add Database to Sourcesafe... at which point a message box appears saying "This database must be closed...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.