|
Nope. If you wanted this kind of functionality, you'd have to move to SQL Server or an equivilent. My personal choice would be SQL Server Express.
|
|
|
|
|
Thanks, that is what i thought was the answer was but wanted to double check.
|
|
|
|
|
Planker wrote: Is there a way I can open the DB with out locking the DB for any other write access
It's been awhile since I last used Access, but when using ADO there was several parameters for the connection string you could specify which would affect how the Access db works.
The records you update will be locked, but if you're not able to open the database using another connection, sounds like the db has been opened in exclusive mode.
You could see the following if there's any help: ADO Provider Properties and Settings[^]
However, if you're going to use the db seriously, I'd also suggest you move on to SQL Server.
|
|
|
|
|
It's not so much accessing the database from another instance of the app as the problem is Access opens the database DenyShareWrite. His explanation was that he couldn't open the database in Access and still have database writes be made by his application.
|
|
|
|
|
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();
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.
|
|
|
|
|
Hi i write a piece of code that is used to get the event log of the Window. and then i get the log Entries
EventLog[] logs = EventLog.GetEventLogs();
foreach (EventLog log in logs)
{
foreach (EventLogEntry entry in log.Entries)
{
if ((entry.EntryType == EventLogEntryType.Error)
|| (entry.EntryType == EventLogEntryType.Warning)
|| (entry.EntryType == EventLogEntryType.FailureAudit))
{
if (lastUpdate.CompareTo(entry.TimeGenerated) < 0)
x.addEvent(entry);
}
}
}
Know when i execute this code on server
it take 60% to 70 % of the CPU . Please give me any idea to make it more efficent so that it take 10 to 20% of CPU
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
Reading the event logs shouldn't be that intensive. I suspect the bottleneck lies around x.addEvent.
|
|
|
|
|
basically i used this code in window service which run on system get the Information of then Event and then send it to the server by web service just for maintaining log for my own purpose. but when i am calling the code that i write it use 60 to 70% of CPU for a min or so. and some time crash the System also.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
How long does it run for / how often do you run it? Efficient code should take 100% CPU, otherwise you are just making your CPU wait for other (in your case hard-disks) components.
If this is taking too much CPU, then you need to run it at a low priority.
|
|
|
|
|
Hello Mark
basically i used this code in window service which run on system get the Information of then Event and then send it to the server by web service just for maintaining log for my own purpose. but when i am calling the code that i write it use 60 to 70% of CPU for a min or so. and some time crash the System also.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
i want to create something like solution explorer or toolbox in visual studio .net that can auto hide and can be closed. I want to create in visual c#.net 2008.
|
|
|
|
|
You want what's called "docking". Google "DockPanel suite".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In the following method, the 'startPos' variable always contains -1 when searching for a string that is known to exist within the RichTextBox.
private string GetHeadingInnerHtml()
{
int startPos = myRich.Find("<head>", 0, RichTextBoxFinds.None);
int endPos = 0;
if (startPos >= 0)
{
endPos = myRich.Find("</head>", startPos + 6, RichTextBoxFinds.None);
myRich.SelectionStart = startPos;
myRich.SelectionLength = ( endPos - startPos );
return myRich.SelectedText;
}
return string.Empty;
}
Any ideas why?
Thanks.
|
|
|
|
|
What's your source text? The Find method which accepts string will not find text, if it is more than on one line.
Regards,
Lev
|
|
|
|
|
If it returns -1, it ain't there.
Are you sure there's no Text property in the myRich object?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I set a watch for the value of myRich.Text property. Then I noticed that an earlier called method cutoff part of the <head> element's starting tag so naturally the Find method did not find it.
Thanks,
Mark
|
|
|
|
|
This worked OK for me. I put the following text into a RTB and it found the details with no problem.
<html>
<head>
<some tesxttlkajsdlfj asdf>
</head>
</html>
If you debug your application, what does myRich.Text contain when you step into this method?
|
|
|
|
|
Hi,
I want my program to close a MessageBox automatically after x seconds, whether the user answers to MessageBox or not.
How is that?
thanks
|
|
|
|
|
Write your own messagebox (just create a dialogform)
Put a timer on it and close the form after x seconds has past.
There might be a better way but this is how I would do it.
|
|
|
|
|
so how can i assign my icon to that as easy as MessageBoxIcon.Information or MessageBoxIcon.Error ... does?
should i use my own PictureBox for it and make all fundamentals from the begining, or is there any other way that i use right that enum (MessageBoxIcon) instead?
|
|
|
|
|
AFAIK, you have to create your own form and use some methods to draw the icon on it. This form can return a DialogResult as message box does.
|
|
|
|
|
If you decide to create it yourself I recommend doing it from scratch.
But the other reply has a link to a nice article that does exactly what you want.
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hi,
please send me code sample for uploading a video in c# .net
|
|
|
|
|
This is NOT rentacoder.com
Nobody is just going to give you code.
You need to do your own research, write your own code, try to get it working and then when/if you get stuck on a certain piece of code you can post it here (with the error message if any) and people will try to help.
That goes for both your posts.
|
|
|
|