Record Locking

daves

Member
Joined
Jun 30, 2006
Messages
19
Programming Experience
10+
Hi,

I'm an Oracle guy and just started using VB. I've developed on Access for many years.

I'm confused with this new way of loading all the data into a form (object) and then writing it all out.

What happens in multiuser applications where mulitiple people update the same data? If 2 people have the employee table open and make changes, (even to different records). Doesn't one over write the other?

I've been looking around for days for this answer. Do you know if there are any sample menuing systems out there?

Thanks,
 
Hi,

The client uses active directories so I don't need a pasword. I just need to store the computer name and the database name. Active directories will do the rest.

I thought I'd read it in in the start up form and put it in a global variable as my connect string and then use it as I needed to...

Does that sound good?

Dave
 
No ... if you already want to read it and again put in a global variable it doesn't make much sense ... means, just because you can do something it doesn't mean that you should do that.
However, if you really insist to config file this is how you can set up the conn string in it:
just add these lines in the <configSection>:
VB.NET:
<connectionStrings>
        <add name="nameoftheconn" connectionString="dbgoeshere" providerName="oledb or sql" />
</connectionStrings>

Regards ;)
 
I don't understand why you don't like that idea. Would you be suggesting the database name / location be hard coded in code?

Dave
 
Hi,

Thank you, it is one line of code but the code has to work on my comptuer at home and my clients. They have sql running on a dedicated server and mine runs from my desktop.

Do you have sample code to read the config file?

thank you!
 
new question..

Hi,

If I use the data explorer to create the binding controls, etc.

When the program runs in production mode (at the client), it is still going to use my local connection strings used at design time, correct? How do you get around this?

What I mean is by setting up a databound controls on winforms.

Thanks
 
Just a word from me the peanut gallery. I only read the first part of this

thread and noticed you are speaking of locking. I have done alot of it

with the MS-Access/Jet DB. See vb2005-Express help:

Using Optimistic Concurrency

Sorry if I'm out of context now.....
 
Hi Zekeman,

No sir, you are not out of context. Your suggestion was bang on. I ended up calling Microsoft Tech Support late last week to discuss this and the gentleman there discussed this Optimistic Concurrency setting with me. It looks like just what I need. Thank you for your suggestion.

BTW, I hope I'm not going off topic but the tech support guy told me that we could use as many ado.net datasources rather then writing seperate queries. He implied that as long as the datasets only one a record or two, it would be easier to program with multiple datasets. Would you agree?

He is looking for an article for me to that discusses Optimistic Concurrency with respect to having multiple tables being updated by multiple datasets in one transaction. Something like a code snippet to show me how to use transaction control and then catch the error if there is a problem and handle it programmatically. I'll post it here if you like... Do you have any such examples?

Thank you once again for you advice.

Regards,

Dave
 
Hi,

I was looking at the code sample you told me about Listview project.. I don't see any code to actually save the invoice. Does this project save the invoice?

Thanks
 
Back
Top