Click here to Skip to main content
15,897,519 members
Home / Discussions / C#
   

C#

 
AnswerRe: Specify entire app.config at runtime Pin
Not Active22-Dec-08 10:07
mentorNot Active22-Dec-08 10:07 
Question.NET 2.0 Windows Service Deployment error on Windows 2008 server. Pin
Member 357347622-Dec-08 4:22
Member 357347622-Dec-08 4:22 
QuestionWriting to an Access DB locks DB Pin
Planker22-Dec-08 3:49
Planker22-Dec-08 3:49 
AnswerRe: Writing to an Access DB locks DB Pin
Dave Kreskowiak22-Dec-08 4:39
mveDave Kreskowiak22-Dec-08 4:39 
GeneralRe: Writing to an Access DB locks DB Pin
Planker22-Dec-08 5:01
Planker22-Dec-08 5:01 
AnswerRe: Writing to an Access DB locks DB Pin
Wendelius22-Dec-08 8:22
mentorWendelius22-Dec-08 8:22 
GeneralRe: Writing to an Access DB locks DB Pin
Dave Kreskowiak22-Dec-08 8:44
mveDave Kreskowiak22-Dec-08 8:44 
GeneralRe: Writing to an Access DB locks DB Pin
Wendelius22-Dec-08 9:31
mentorWendelius22-Dec-08 9:31 
Dave Kreskowiak wrote:
explanation was that he couldn't open the database in Access and still have database writes be made by his application.


I understood that and I got the feeling that the first connection to the db (his application) opens it in exclusive mode for some reason.

Perhaps I'm still missing something, but I made a test with a fresh db with only 1 table (Table1) where I tried to simulate the problem:
System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection();
connection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\...\db1.mdb";
connection.Open();
System.Data.OleDb.OleDbCommand command = connection.CreateCommand();
System.Data.OleDb.OleDbTransaction transaction = connection.BeginTransaction();
command.Transaction = transaction;
command.CommandText = "INSERT INTO Table1 (Field1) VALUES ('A')";
command.ExecuteNonQuery();
command.CommandText = "INSERT INTO Table1 (Field1) VALUES ('B')";
command.ExecuteNonQuery();
// Breakpoint here
transaction.Commit();


Before the commit I stopped the debugger. While still in debug mode I opened the mdb file from Access 2003 UI and then opened Table1. Didn't see the rows A and B as expected but all the previous rows where present. When I went through the commit and then re-opened Table1 rows A and B were present.

So all the time I was able to for example query the table. Also I was able to modify data in another table while transaction from C# was in action. Didn't try to update the same table since I suspect that when using defaults, page level locking is used.

The need to optimize rises from a bad design.My articles[^]

QuestionHow to make Efficient algorithm Pin
wasimsharp22-Dec-08 3:44
wasimsharp22-Dec-08 3:44 
AnswerRe: How to make Efficient algorithm Pin
Pete O'Hanlon22-Dec-08 4:36
mvePete O'Hanlon22-Dec-08 4:36 
GeneralRe: How to make Efficient algorithm Pin
wasimsharp22-Dec-08 20:40
wasimsharp22-Dec-08 20:40 
AnswerRe: How to make Efficient algorithm Pin
Mark Churchill22-Dec-08 19:17
Mark Churchill22-Dec-08 19:17 
GeneralRe: How to make Efficient algorithm Pin
wasimsharp22-Dec-08 20:35
wasimsharp22-Dec-08 20:35 
Questionauto hide Pin
erdem0122-Dec-08 3:27
erdem0122-Dec-08 3:27 
AnswerRe: auto hide Pin
#realJSOP22-Dec-08 3:28
professional#realJSOP22-Dec-08 3:28 
QuestionRichTextBox.Find method fails to find known string. Pin
Mark F.22-Dec-08 3:21
Mark F.22-Dec-08 3:21 
AnswerRe: RichTextBox.Find method fails to find known string. Pin
Lev Danielyan22-Dec-08 3:26
Lev Danielyan22-Dec-08 3:26 
AnswerRe: RichTextBox.Find method fails to find known string. Pin
#realJSOP22-Dec-08 3:27
professional#realJSOP22-Dec-08 3:27 
GeneralRe: RichTextBox.Find method fails to find known string. <<< Fixed! Pin
Mark F.22-Dec-08 4:00
Mark F.22-Dec-08 4:00 
AnswerRe: RichTextBox.Find method fails to find known string. Pin
Pete O'Hanlon22-Dec-08 3:32
mvePete O'Hanlon22-Dec-08 3:32 
Questionhow to close MessageBox automatically Pin
Sajjad Izadi22-Dec-08 3:12
Sajjad Izadi22-Dec-08 3:12 
AnswerRe: how to close MessageBox automatically Pin
Tom Deketelaere22-Dec-08 3:19
professionalTom Deketelaere22-Dec-08 3:19 
GeneralRe: how to close MessageBox automatically Pin
Sajjad Izadi22-Dec-08 3:31
Sajjad Izadi22-Dec-08 3:31 
GeneralRe: how to close MessageBox automatically Pin
N a v a n e e t h22-Dec-08 3:35
N a v a n e e t h22-Dec-08 3:35 
GeneralRe: how to close MessageBox automatically Pin
Tom Deketelaere22-Dec-08 3:41
professionalTom Deketelaere22-Dec-08 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.