|
edmonson wrote: Any idea, why the server process stopped ??
Alas, no. Is it replicatable?I are Troll
|
|
|
|
|
Sorry, the message was:
Sure, your code works and the database is deatached succesful!
but when I execute an attach again(the same database):
- Database is attached successful (I can see on Management Studio)
- I open a connection an it opens succesful.
- But when I call an cmd.ExecuteReader to get data, then next error message appears:
"Error at level transport when send the query to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe)"
I've reviewed SQL configuration, and all seems good.
If I restart the App all work succesful.
Any idea about it ?
|
|
|
|
|
I don't know; does it happen every time after a reattach?I are Troll
|
|
|
|
|
Yes, every time I attached again (without exiting from application) and try to get data, the problem appears.
But if I restart application and reattach then works fine !
(Strange behavior )
If I find the solution I'll report it.
|
|
|
|
|
edmonson wrote: Yes, every time I attached again (without exiting from application) and try to get data, the problem appears.
Without exiting from the application; so something gets left behind, in either the application or SQL Server. When the application starts to fetch data, then the application will create a new Connection object, right?
Thinking out loud; the database is re-attached, from within the application. Could it be that we disconnected an active DataReader during the detaching?I are Troll
|
|
|
|
|
|
They also got a webservice[^], wouldn't that be easier to interface with?I are Troll
|
|
|
|
|
Sorry Eddie,
but I'm trying to program some interaction with webpages, not trying to buy an excel datasheet.
My program needs now and then some distance calculations, and I'm not using it professionally.
Further more, I cannot find an option to program interaction with the webservices. They just offer some data for sale.
Still need help to communicate with e.g. the forementioned website, but others as well.
I think I can adapt the eventuel solution to other sites probably, so I'll stick to my help request as it is for now.
Kind regards,
Onno
|
|
|
|
|
Google for "vb.net web page scraping".
|
|
|
|
|
Thx.. I'll go and give it a try. Might just do the trick.
|
|
|
|
|
orvries wrote: Still need help to communicate with e.g. the forementioned website, but others as well.
Once you push the button on the page, it'll load a new page, based on the URL. You'd have to build this URL from code, transferring the correct parameters. As an example, by changing "gouda" to "amsterdam[^]" in the URL, you'll get a different result.
Once you have that, you can fetch[^] the results. Last, you'd need to parse the results, cutting out those parts of the data that you're interested in.
You might want to search for "web scraper vb.net" to get some examples.I are Troll
|
|
|
|
|
Thx.. I'll go and give it a try. Might just do the trick.
BTW the change you suggested did give other text-output on the screen, but the calculated route was not affected. That seems to depend on the previously determined coordinates by the first button press. But I might filter those out of a stream that I get as you indicated.
Thanx a lot for helping me going again!
|
|
|
|
|
Hi all
Can someone plz me about writing codes for asymmetric encryption
I must provide 2 keys in a text box the the program will display the encrypted text in a text box
thnaks
it very urgetn for an assignment
|
|
|
|
|
faizalfz wrote: it very urgetn for an assignment
But not urgent enough to do this[^]?txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I am trying to design a pop-up notification in VB. For example i have an expiring date for some items and wants to notify the user about item that are about expiring and the number of days left. I am using VB and Microsoft SQL Server. ANy help?????
|
|
|
|
|
I can't see the problem here. You either need to design your own form and populate it, or you need to use a Message Box like this MsgBox(String.Format("{0} will expire on th {1}",Product.Name,Product.ExpiryDate) . I am not sure what you really need to do.
|
|
|
|
|
What have you tried so far?
Sounds an easy enough task, but if you are stuck getting the code to work, post a relevant code snippet describing the problem and I'm sure we can help you out.
|
|
|
|
|
Hi all...
I am creating a project to monitor files of USB disk each time when it is inserted.
When a USB disk is inserted, a thread starts and checks all executable files in usb disk. when user run any executable in usb disk then thread immediately stops its execution. The code is working properly but it slow down the system.
The code is below :
Private Sub StartMonitoring()
Dim MonitorList As New List(Of String)
For Each drive As DriveInfo In System.IO.DriveInfo.GetDrives
If drive.DriveType = DriveType.Removable And drive.Name <> "A:\" Then
DriveName = drive
End If
Next
For Each file As String In My.Computer.FileSystem.GetFiles(DriveName.Name,FileIO.SearchOption.SearchAllSubDirectories)
If IO.Path.GetExtension(File) = ".exe" Then
MonitorList.Add(File)
End If
Next
Do While Not memThd Is Nothing 'memThd is thread which is started to monitor.
Try
For Each prcName As String In MonitorList
For Each prc As Process In Process.GetProcesses
If IO.Path.GetFileName(prcName) = prc.ProcessName & ".exe" Then
prc.Kill()
catch ex as exception
msgbox(ex.message)
End Try
Loop
End Sub
The code is working perfectly but it slow down the system.
Suggest me some way to maintain system speed while running this thread or some other way to write the above code.
Thanks
Gagan
|
|
|
|
|
I must say that if drive is A your code will not work, as you don't set DriveName but use the variable.
Also... what's the purpose of this? Kill any process started from the pen-drive? Are you trying to avoid viruses this way?
But, about the fact it is slow, any non-stopping code makes the computer slow. You can try to set the thread priority to Idle... this could help.
|
|
|
|
|
Paulo Zemek wrote: I must say that if drive is A your code will not work
I have already checked if drv.DriveName<>"A:" then starting the thread.
Paulo Zemek wrote: You can try to set the thread priority to Idle...
I set the prority of threat to 0 (i.e. lowest priority) but it has no effect.
Suggest me some other ways.
Thanks.
Gagan
|
|
|
|
|
It slows down the entire system because your code is horribly inefficient.
Did you notice that you're calling Process.GetProcesses (kind of expensive) each and every time you look at a new item in the MonitorList ?
You're also consuming 100% of the CPU since your loops doesn't yield at all.
You also have the problem of killing off a legit process running off the hard drive with the same name as one stored on the stick.
Killing off a process rather abruptly opens the system up for data corruption and system instability if the app doesn't get the chance to close gracefully.
Your have two "fixes" for the performance problem. First, switch your loops so your only getting the Process list once per pass. Second, put in a Thread.Sleep (with an appropriate value) to put this thread to sleep for a second or two before it goes for another pass.
Look, you really can't stop someone from running applications off of a USB stick like this. There is a group policy that can stop this without you constantly killing the CPU to do it. It's also quite easy to kill off your process and launch an app anyway.
|
|
|
|
|
Dave Kreskowiak wrote: Your have two "fixes" for the performance problem. First, switch your loops so your only getting the Process list once per pass.
I created a list of all running processes and stored it in ProcessList.
Now I am comparing the executable file stored in MonitorList with process name stored in Process List.
Dave Kreskowiak wrote: Second, put in a Thread.Sleep (with an appropriate value) to put this thread to sleep for a second or two before it goes for another pass.
I put this thread to sleep for 1 second as memThd.sleep(1000) after one iteration.
But it does not speeds up my system.
Suggest me some other ways.
Thanks.
Gagan
|
|
|
|
|
I have no idea what you're app is doing to tie up the CPU so badly. If you rewrote the code, properly, the way I suggested, this wouldn't be a problem anymore. Of course, without seeing the modified code, it's impossible for me to tell you what's going wrong.
|
|
|
|
|
hi all
i create a setup file with vb.net2008 in win app
in setup class i have a function that install msde with process.start instruction.i copied the msde2000 folder in bin folder in my application and use this code for setup class:
Dim fsOutput As New FileStream(Application.StartupPath.ToString & "\MSDE2000\setup.ini", FileMode.Create, FileAccess.Write)
my function is true but when i run setup.exe file, this error is shown:
could not find a part of the path "c:\windows\system32\MSDE2000\setup.ini"
my program is in drive f. but why is it looking under "c:\windows\system32"
please help me M.Alizadeh
modified on Tuesday, March 2, 2010 4:00 AM
|
|
|
|
|
try this
Imports System.IO
Imports System.Reflection
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End FunctionBest Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|