No I don't. I'm no expert, but I think perhaps the operating system would view what you're trying to do as an attempt to "take over" the system. This is because your program would be interfering with a system process. With security being such an important issue these days, I doubt Windows will permit it.
Anti-virus programs sometimes prevent Windows from shutting down when you run executables that are not trusted and the anti-virus blocks the behavior.
Then you cannot even shutdown windows using the shutdown forcefully command from the command prompt. You have to turn off the power on the machine.
Are you just trying to prevent the automatic reboot with windows update? You can modify the registry
I've been getting increasingly annoyed at my computer today owing to a most peculiar problem. Whenever I run my VB.NET 2010 console application with no command-line arguments, the icon in the console window caption is displayed as my application's icon just as it should be.
However, when the application is run with one or more command-line arguments, the correct icon is not displayed, and is replaced by the default icon for executable files. Does anybody know why on earth this is happening and what I can do to solve it?
I'm afraid there isn't enough information to work on.
- How do you launch your console app? inside a "Command Prompt"? using an Explorer shortcut?
- What is your operating system?
- Does your code do anything at all regarding its icon(s)?
- what are the icon sizes you provided in the .ico file?
suggestion: try on different machines, also running different Windows versions.
Sorry if my question was slightly brief, here's the information you requested:
- The icon displays correctly when launched from windows explorer by double-clicking the program icon. When I launch it in debug mode from VB Express it's icon does not display at all, regardless of command line arguments (though I assume that this has something to do with the Visual Studio hosting process). When launched from "cmd.exe", the icon remains as the standard icon for the command prompt regardless of arguments provided.
When the program is launched because a file of a type associated with it (through the registry) is double-clicked in windows explorer, the icon does not display correctly, the default executable icon is used instead.
- My OS is Windows 7 Home Premium.
- My code does not alter the caption icon in any way.
- The icon sizes in the .ico file are 256x256, 128x128, 48x48, 32x32, 24x24 and 16x16 all of which are in 32-bit colour.
Until about 2 minutes ago, I had assumed that it was the command-line arguments that were causing this problem, but it appears to be the fact that the application is being launched through opening an associated file type with it. The DefaultValue value in the shell/open/command registry key associated with the file type is:
I'm sorry for neglecting to make this clear in the first place.
I am working on a program that accesses two different databases. One of them has only one table and I am not having any problems with access/working it. The second database has three tables in it that I need access to and this is where the problems arise.
I have no problem reading the tables. I can navigate the records and even delete them without issues. However when I try to update a record, or add a record to the database I get the following error messages:
When trying to edit/update a record:
System.Data.OleDb.OleDbException was unhandled
Message=Syntax error in UPDATE statement.
When trying to add a record:
System.Data.OleDb.OleDbException was unhandled
Message=Syntax error in INSERT INTO statement.
I have looked over the code time and time again and I can't find anything wrong with it. It is identical to the code that I currently have working with the single table database. Below is one of the code blocks that I am having issues with:
Private Sub btnCommitSignin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommitSignin.Click
Dim SignCB As New OleDb.OleDbCommandBuilder(SignDataAdapter)
Dim SignNewRecord As DataRow
SignNewRecord = SignDataSet.Tables("SignIn").NewRow()
SignNewRecord.Item(2) = cmbpatronsignin.Text
SignNewRecord.Item(1) = txtDateSignin.Text
SignNewRecord.Item(3) = txtTimeIn.Text
SignNewRecord.Item(4) = txtTimeOut.Text
MsgBox("New sign-in registered.")
SignMaxRows = SignMaxRows + 1
SignInc = 0
cmbpatronsignin.Visible = False
txtDateSignin.Visible = False
txtTimeIn.Visible = False
txtTimeOut.Visible = False
btnAddSignIn.Visible = True
btnEditSignin.Visible = True
btnDeleteSignin.Visible = True
btnCommitSignin.Visible = False
btnApproveSignin.Visible = False
btnCancelSignIn.Visible = False
The program always crashes at the line:
If I comment it out and rerun the program, the dataset updates without any problems so I know that it has to do with the update command.
What could be some of the issues that I am having? What are the solutions to them?