Hello, I am trying to look in a table to see if the item already exisits before I add another one. I have a simple table with 2 fields. The primary key is one and it is an auto number, the other is the description that I am trying to check for.
The name of my table is OrdersListBoxInfo and the table name I am trying to compare with is Order. Once I get to the line "Count = cmd.ExecuteScalar" I am getting error "No value given for one or more required parameters."
Here's the code I am running. Can anyone tell me what I am missing/doing wrong?
Dim OrderName As String
OrderName = txtOrderName.Text
'Check to see if this Order already exisits
Dim Count As Integer = 0
Using Connection As New OleDbConnection _
("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Costco\My Documents\Visual Studio Projects\AnesXL.mdb")
Dim cmd As OleDbCommand = New OleDbCommand _
("Select Count( OrderName ) as ExistingRecords From [OrdersListBoxInfo] where [Order]=?", _
Count = cmd.ExecuteScalar
If Count > 0 Then
MessageBox.Show("Number of rows found: " & Count, "Add Date", MessageBoxButtons.OK)
First, you're app is writing a script file, then launching an external application which executes the script. Is this FTP a DOS app or a Windows app?? If DOS, then you need to pipe the FTP app's output to another file using a command line similar to:
ftp -s:scriptname > C:\ftpOutput.txt
When the Shell statement returns, you have to open the ftpOutput.txt file and read its contents and parse it up, looking for keywords that should tell you if the transfer was successful or not.
This WILL NOT WORK if FTP is a Windows app!
The best solution is to scrap all this and rewrite a new app using an actual FTP component in your app where you'll have FAR more control over the transfer process and the results of it.
Does anyone understand why when i put an image in the background of a form that it displays correctly for approximately 5 seconds but then the same image is applied within the window overlapping the first image but offset. The only way i've found to get around this is to set the 'Show in taskbar' to false.
I've also found that if i minimise the form and then restore it, it does exactly the same thing, the image in the form appears okay for 5 seconds and then does this overlap thing.
The form is approximately 800x600 pixels and set to appear in the centre of the desktop. If i set the form to 'manual' and have it start at position 0,0 then the overlap thing doesn't occur, or if it does, then it's not obvious as it must be overlapping in exactly the same position.
Any ideas other than putting it into a picture box, which isn't an option as i have text with it's back colour set to transparent, and the transparency is obviously lost if i put text over a picture box.
It's not a multiple frame image no, just a BackgroundImage on the form, an index coloured png file at that, just to try and keep the file size down.
Basically i have made a card game and in the game you choose one of 5 options and depending on the option chosen dictates which backgroundimage is visible. It's basically to give it a nice GUI, instead of a plain colour.
I am starting to think that maybe the issue lies simple with my version of VB.Net.