|
Hi all,
Thanks to all who replied to my posts earlier.
I have another query that go as follows:
How to quit an application that is already open open the local machine from the application that I have done in vb.net.
ie: close other application that is open/running or close other application that is using the same database.
Thanks in advance.
|
|
|
|
|
I have used the below code to quit the other application that is running.
Catch exp As Exception
MsgBox("The Database is used by Ariane. Easy ECN will exit Ariane now.")
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("db2krun")
For Each p As Process In pProcess
p.Kill()
Next
|
|
|
|
|
HI,
How to check how many thread currently running??
Any possibility to get the solution ??
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
|
I have never found a way to take advantage of thread names. Ideally one would give Thread instances a name, and be able to identify them by that name (rather than by a system-assigned number), however it does not work at all.
Furthermore, managed threads are virtual, there is no guaranteed one-to-one relationship with actual Windows threads, so you can't easily recognize your managed threads when looking at the output of tools such as Process Manager/TaskInfo
|
|
|
|
|
Hi all,
I have a vb.net application that uses dbase as the database.
When I run the application, if another application using the same dbase databse is open, the application crashes.
How to handle this case.
Any suggestions will be helpful.
Thanks in advance.
modified on Thursday, November 18, 2010 5:07 AM
|
|
|
|
|
A try/catch block around the code that gets a connection to the database?
|
|
|
|
|
Make sure that your app doesn't run when the other application is open. You can enumerate all the Windows on the desktop to check whether that's the case.
What version of dBase are you referring to? 4?
I are Troll
|
|
|
|
|
Thanks for the reply.
I'm using dbase IV.
|
|
|
|
|
Are you opening the dbase file in "Shared" mode ? Sounds like you are trying to access a resource with exclusive access and it cannot give it to you because someone else already has the resource.
I don't know the details of how to open a dbase file. I'm just talking theory here.
Good Luck.
|
|
|
|
|
Thanks for the reply.
The dbase file is not used in the shared mode.
Its on the server.
The same dbase file is used by another application and when that application is open, my application crashes.
|
|
|
|
|
Shared mode is for more than one concurrent user
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
An application crashing means you didn't take care of error and/or exception handling properly. Make sure you do, and the app will tell you what is wrong.
|
|
|
|
|
By using catch block and killing the running application, I solved this case.
Thanks for all those who replied and gave suggestions.
It help me to find a solution.
code:
Catch exp As Exception
MsgBox("The Database is used by Ariane. Easy ECN will exit Ariane now.")
Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("db2krun")
For Each p As Process In pProcess
p.Kill()
Next
|
|
|
|
|
|
The exception is too general, that might hide problems later on. It'd be preferable to loop through the processes, and to exit if "db2krun" is running. Like this;
Dim pProcess() As Processes = System.Diagnostics.Process.GetProcessesByName("db2krun")
If pProcesses.Count > 0 Then
MsgBox("The Database is currently being used by Ariane. Easy ECN will exit now.")
Application.Terminate
End If
Most importantly, this code would cause your application to exit, as opposed to killing the other application. Imagine a grumpy old man, on a day without coffee. I've been typing in this Ariane for what feels like hours, and just when I'm about to hit the "save" button, and some guy kills the application! What's more, some applications refuse to restart if they're killed at the wrong moment.
The nice thing to do, is to refuse to start at all; the user hasn't any unsaved work in your application, it just began initializing.
I are Troll
|
|
|
|
|
I have been tasked to write an VB.Net application with all reports to be written in SSRS. I have never done SSRS so the first questions,
1. How can I print the report straight to printer and not first browser then print. Can this be done?
2. Can you create a PDF file and not first via browser
What would be the easiest and the fastest way to do these reports from VB.NET?
Thanks in advance.
|
|
|
|
|
This blog post[^] is about the closest you're going to get. It references SSRS 2000, but should still work for 2005. The code is in C#, but is easily converted to VB.NET using any of the online conversion tools.
|
|
|
|
|
Hi all
I has an vb.net application taht is developed in vs 2008.
I created a test cretificate in the Signing tab for test purpose.
Now I want to delete that certificate.
How to do that.
Any help will be helpful.
Thanks in advance.
modified on Thursday, November 18, 2010 3:35 AM
|
|
|
|
|
Start -> Run -> certmgr.msc
You'll probably find the certificate in the Personal folder. Delete JUST your code signing certificate. DO NOT DELETE ANY OTHER CERTIFICATES!
|
|
|
|
|
Thanks a lot.
I have deleted the certificate from the personal folder.
But I find the TemporaryKey.pfx file in my project and I also find in the Signing tab in the Sign the ClickOnce manifests the certificated issued is still displayed.
Ho to remove this?
Thanks in advance.
|
|
|
|
|
OK, so clear the checkbox next to "Sign the ClickOnce manifests" and delete the .pfx file from the project.
|
|
|
|
|
I deleted the .pfx file from the project and cleared the checkbox next to the signing.
But find that the inside the text box, the issued by, issued to ,etc ate displayed but disabled.
Once I check the ClickOnce manifests, it is again displayed active.
Will that affect while publishing the application?
Thanks.
|
|
|
|
|
If the checkbox is turned off, it won't be signed anymore, regardless of what's in the greyed out textbox.
|
|
|
|
|
Thanks for the reply.
I understand now.
|
|
|
|