|
Fida_Bhittani wrote: MySQl Queries in Vb.NET For My Data Base.
There is no difference in terms of writing queries - you need to know the difference between the database you were already using and mySql but writing queries in terms of VB.Net remains fairly the same.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Walaiku-mussalam.
Before you execute any query, u have to connect with that database from VB.NET. u can use ODBC, OLEDB or anything depending upon your database server. After that u can execute any query that is supported by database server. Any farther Question please mention your database server name.
|
|
|
|
|
Aslam_Iqbal wrote: Any farther Question please mention your database server name.
The OP has already mentioned that it is a MySQL database. Do pay attention.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello,
I’m new to this so my apologies up front for either too much information – or not enough.
I’ve been creating a VB program, with 2010 Express, that reads positional information from an accelerometer and plots the data with Zedgraphs – wonderful stuff.
I’ve added audio playback with 5 different .wav files so you can hear the movement, rather than just look at the graph. It works great most of the time but pretty consistently crashes the program when I cycle thru the .wav files too quickly (multiple times per second). I’ve added them as a resource to the build which seemed to help some – but still not good enough.
I’m now thinking it’s because the program is reading the .wav files from disk and I now need to have them in system memory for quicker access…
Am I thinking about this the right way? If I’m not, any direction would be appreciated. If I am, then is DirectX the best path or is there some other way?
Thank you in advance.
|
|
|
|
|
JKenny76 wrote: Am I thinking about this the right way?
No, you're not. If you added the sounds as resources, they're already in memory.
Without knowing what your code looks like that is playing these sounds, it's very difficult to tell you what's wrong.
I can take an educated guess though. If you're switching sounds as fast as you say you are, you might have to look into using DirectSound to play your sounds.
There's lot's of examples on the web. All you have to do is Google for "VB.NET play sound DirectSound".
|
|
|
|
|
Dave,
You're a gentleman and I thank you for your advise. When you said that the resource was already in memory it started me thinking - sometimes a painful event...
Anyway, all of my testing was in the debugging mode. Once I compiled the program everything worked as expected and there was no crashing!
I thank you for your time and patience.
Joe
|
|
|
|
|
- I have an application that is developed using VBA for automating excel spreadsheets to create and accounting system. Is it advisable to migrate the code to VB.NET going foward, e.g. for consideration of continuity will VBA continue to be as is, backward compatible or is vb.net going to be language of choice with applications?
|
|
|
|
|
Microsoft has announced no plans to replace VBA with VB.NET. So, for at least the next version of Office, VBA is still going to be what's built into it.
|
|
|
|
|
VBA will continue to work. Corporations won't upgrade Excel if Microsoft killed VBA since so many macros have been written.
Upgrading Visual Basic (not VBA for Excel) to VB .NET is a nuisance. If you had to port a significant amount of code, you also could consider C#.
I personally prefer to use Excel C API as much as possible, and a minimal amount of VBA.
|
|
|
|
|
Hello again, any one can help me how to make windows can't for shutdown/reboot/loggoff if my form/application is still running/active?
modified on Tuesday, December 28, 2010 7:27 AM
|
|
|
|
|
If you had learned to use a search engine before asking here you might not have had to wait for over two hours for a response.
A quick search using the first search phrase that came to mind vb.net prevent windows shutdown gave me over 150,000 hits. I'm sure that one of those will have a solution that you can work with.
WARNING
Be very, very sure that this is what you want to do and that there is no other alternative. Quite simply if I want to close down my computer and an application prevents this, that application gets uninstalled immediately.
This is also the sort of methodology that inexperienced virus writers try to implement, so you can expect to get some unpleasant responses.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you. I have search on google and found many sample of code but no satisfactory. So i think i will get better solution here. Before i just use it:
<br />
Private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)<br />
If UnloadMode = vbAppWindows then<br />
Cancel=1<br />
End If<br />
End sub
This works great on windows xp, but in vista and 7.
I just make an internet cafe software. Before, i made it in vb6, now i'm trying using microsoft access. But now i found those methode not works properly in vista and 7.
modified on Tuesday, December 28, 2010 7:09 PM
|
|
|
|
|
I agree with what Henry said, and consider it poor practice which will arouse suspicion. The user can always hit the big red button and close down anyway.
The only acceptable approach, in my view, is to use the Form__FormClosing event to throw up a modal dialog box to ask the user if they really want to do this. This will hold the Shutdown/Restart/Log off process. I also check to see if there are any unsaved data, and if so, then modify the dialog box appropriately.
|
|
|
|
|
Thank you. I already have hide the control box (close,min/max button) and prevent user to close by pressing Alt+F4 of Ctrl+F4.
modified on Wednesday, December 29, 2010 1:54 AM
|
|
|
|
|
You can prevent Windows from shutting down - to a point. It's entirely possible for someone to shutdown Windows and they will force your app to close. There is no way to prevent this from happening. Your process is just stopped and removed from memory.
|
|
|
|
|
Yes, you are true. But i have make a code for hiding my application process.
|
|
|
|
|
First, you can't hide a process from everything.
Second, you surely can't hide it from Shutdown. When you tell Windows to force close everything, you're process is going to be forcibly stopped and removed from memory, and there's nothing you can do about it.
|
|
|
|
|
Thanks for your fast reply. My code works fine in windows xp without any interuption. But in vista and 7 have a dialog screen which ask user for force close everything as you told. But, i just try to add some code to send "ESC key", so i can't close those dialog screen in vista & 7. But i still have problem with switch user and sleep option.
|
|
|
|
|
Yance Lawang wrote: But, i just try to add some code to send "ESC key",
Which isn't going to work. When you see the "Force Close" screen, you're not looking at the same Desktop you as a normal user sees. This screen is painted with a snapshot of the users Desktop and doesn't respond to SendKeys or other input injection. Like I said, you can't stop this from happening.
|
|
|
|
|
I'm sorry. But i it is work, i can close that screen using my code.
modified on Wednesday, December 29, 2010 12:08 AM
|
|
|
|
|
No offense, but...
If a user wishes to shut down his computer, it is not your place to try and prevent it. That's the user's choice to make, not yours.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
thank you very much Alan. But it is my own computer. I in project to make an internet cafe software for my own i-cafe. So, i think i may do that...even it is must...
modified on Wednesday, December 29, 2010 4:55 AM
|
|
|
|
|
I once set up a PC-based casino for a client. The only solution I found, other than the ability to disable the shutdown button, was to put the PCs in locked boxes, so the user could not hit the BRB (big red button).
|
|
|
|
|
Yes, absolutely. But i can prevent the shutdown verry well in windows xp without disable the BRB. But it seems this way does'nt work on windows vista and 7. Then, when i add code to send "ESC key" when dialog screen in vista & 7 for force to close application, now i can prevent shutdown too in vista and 7. But i still have problem with "switch user" and "sleep" option, and if we press ctrl+alt+del. I never found suitable code for disable the ctrl+alt+del in vista & 7 like in windows xp.
|
|
|
|
|
Yance Lawang wrote: Then, when i add code to send "ESC key" when dialog screen in vista & 7 for force to close application, now i can prevent shutdown too in vista and 7
Really? I'd be willing to bet that the only thing you tested this against was clicking the Shutdown button.
You didn't test it against Start -> Run -> SHUTDOWN /F.
You also didn't test it against Start -> Run -> TASKKILL ...
|
|
|
|