I'm trying to execute a SQL command, but I just can't find out why this is not working. This is how I defined the "execute" function in my class named "clsSQL":
[Code]...
Probably, I just need another pair of eyes, 'cause I can't see what am I doing wrong Could this be related to the database and not to my code?
I'm trying to execute a SQL command, but I just can't find out why this is not working.This is how I defined the "execute" function in my class named "clsSQL":
Everything I read says calling an SQL Server stored procedure (SP) via ExecuteNonQuery .ExecuteNonQuery(cmd) should return the number of rows affected. When I run my code it successfully inserts a new record but it returns -1. The SP itself is coded to return (0) if successful else return (-99). It is these values that I want to test after execution. I have tried to add a return value parameter to the DBCommand but this causes an error on that parameter: Quote:
I keep getting a syntax error on the ExecuteNonQuery command. I am sure that the table names and column names are correct. Anyone see what I am doing wrong? Am I using any reserved words as column names or something?
Dim da5 As New OleDbDataAdapter("SELECT JobPlanNumber, SLPartNumber, Quantity, Order FROM tblSLMaterials WHERE JobPlanNumber = ?", cn) Dim ds5 As New DataSet
(using vb.net) On our intranet site we have an app that loads customer or vendor information and then allows the users to edit info and add/update/delete contacts. I'm not sure what really changed to this program lately, but I keep getting this error:
Method not found: 'Int16 DBLayer.DBTools.ExecuteNonQuery(System.String, DB)'.
This occurs when i try editing any customer info and the vendor contacts, but the program works when I try editing the vendor info/addy. Here's the program code. There's a seperate program on our webserver that contains the classes used. Here's the main code that calls the classes:
TO ADD CONTACT M2MInterface.M2M.Customers.AddContact(Session("CustVendID"), txtFName.Text.ToUpper.Trim, txtLName.Text.ToUpper.Trim, Tools.RemovePhoneNumberFormat(Phone), Tools.RemovePhoneNumberFormat(Fax), txtEMail.Text, txtNotes.Text, False) TO UPDATE CONTACT
I have a sub in which I call different subs, depending on a value I pass through. It works fine for all but the last one. It executes the sub I call but then comes back to the first sub and runs the second one again
I am working with a datagridview and 2 text boxes.TextBox 1 is for entering time of the day and TextBox2 is for entering time duration in that order. After TextBox2 looses focus I am converting the times into index numbers in my DGV1 and filling the selected indexed rows with some data. The data then is checked and if there are issues message is display prompting the user to correct it. However, all my codes for checking the data and selecting options are in the DataGridView1 event handler:
Private Sub Datagridview1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MouseUp
Is there a way to execute one Subroutine from another Sub. Sort of simulating a mouseup click programmatically ? Correction: there are 7 sets of those TextBoxes representing 7 days of the week. I am trying to avoid duplicating all that error handling codes in all 14 boxes. I have read that MouseEventArgs are protected so it may not be easy.
So, I want to execute a javascript on WebBrowser1 when I press a button. Normally, I'd just navigate to the javascript to execute it. Like this:
Private Sub WebPageEditorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WebPageEditorToolStripMenuItem.Click WebBrowser1.Navigate("javascript:document.body.contentEditable='true'; document.designMode='on'; void 0")
[Code]....
This makes it where I can't leave the website and it keeps me on that one website. But the problem is that navigating to the javascript is not like [URL] so it won't let me execute javascripts that way. So, basically, my question is:
Is there any other way to execute a javascript with Visual Basic 2008 without navigating to it?
i seem to be having issues with my simple count down project. The count down work how I want it, there is also a pic of a rocket that move up when the count down button (Button4 - the form was set up in class as a quick example, so there was no need to name the buttons) is pressed. The problem is that the count down "10....1...Blast Off" shows after the rocket has moved up, I want the countdown text to show, then the rocket to move.The countdown is outputted to a ListBox.Here is my code thus far: (I have re-worked is a bit, starting to look messy)
[Code]...
I am not sure if I should be doing it as a function, that was just one of my attempts to get it to output everything in the right order.
I wanna know how could I do to:Assemble a finished program, install it, and leave it executing in second plane to just push a key to work. Execute it once at the windows start and execute just a single key to make it work.I'd like to know what should I put before the assembly
If certain conditions are met within a given subroutine, I would like to execute two other subroutines. Note that the other subroutines I want to call/execute "handle" a lot of events
vb Private Sub S2_Enter (ByVal sender As Object, ByVal e As System.EventArgs) Handles S2.Enter If upltschanged = True Then
I've created a program that creates a registry value when it is run, and when this program is uninstalled I need it to remove this registry value if it exists. So I wrote a little command line VB.NET program that simply checks for the reg value and removes it if it exists and I added this to the Uninstall section of the Custom Actions tab in the Visual Studio deployment project that I created for this app.
I know that the command line app works because if I run it myself manually it deletes the registry value, but when I uninstall my application it does not remove the registry value so obviously this command line app is not being executed.
Ok I'm creating a sql query with a string variable and executing it in vb. The string would look something like: Insert Into Table (vara,varb,varc) Values ('vara','varb','varc') This works fine.
I have published application before and they all (3 setup files) work fine. The problem is I don't know anymore how I exactly did it. Now I am trying to publish another form which has a connection to my sql database. The publishing goes fine: publishing folder is: C:Movie-databaseApplication 4 and installation folder is the same, and I therefore leave it empty. Application is available only online. But when I execute the published setup.exe I get two windows with no info about the error: see attachment.
I have published application before and they all (3 setup files) work fine. The problem is I don't know anymore how I exactly did it.Now I am trying to publish another form which has a connection to my sql database. The publishing goes fine: publishing folder is: C:Movie-databaseApplication 4 and installation folder is the same, and I therefore leave it empty. Application is available only online.But when I execute the published setup.exe I get two windows with no info about the error: see attachment.
I'm trying to create a program that does the following:Executes the following command line string (wmic /node:computername bios get serialnumber)Prompts user for the "node" entry Displays the resulting serial number in a dialog box I'm a bit of a noob at this (I haven't coded anything in VB since early 2000s) so I'm at a bit of a loss where to start. I plan on including some functions to submit the node entry and the resulting serial number to a database in the future for archiving as well.
Is there a command in vb that can be used to pause a routine to give time for the form to show before the routine starts as my routine is running and completing before my form shows up?
I've just upgraded a project to .net 4.0, I'm getting an odd error using ExecuteNonQuery: Errors: {"Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration infor
Dim xServer As Server = New Server(SQLServer) Dim db As New Database(xServer, Database) db = xServer.Databases(Database) Dim xUser As New User(db, LoginName) xUser.UserType = UserType.SqlLogin
I have a program where a user can update their Password by Entering their old password in a textbox, and entering their new password in a separate textbox.
An update query then updates the database with the new password.
CODE:
However, everytime the code gets to cmd.ExecuteNonQuery(), it throws up an error saying that there is a syntax error in the Update query. However, If I use this query in Microsoft Access, it works fine so the Update query itself is written correctly. What could be wrong?
Note: I am using an UPDATE query in another piece of code within the same Sub routine and it works there. Its something about this query.
Note Again: If I change the Update query to UPDATE Users SET EMAIL = '" & tbPassword.Text & "' WHERE userID = " & Row.Item(0)" it works. Something about Password that throws that error.
Is there any way that i can be able to get the ExecutenonQuery to Execute faster. Am using it to run mysql queries that have joins from diffrent tables. As I have come to notice, the user has to wait a while before the statement ExecutenonQuery can be completely executed.. is there any way that I can get it to execute faster?
SELECT Inventory.Inventory_Id, Inventory.Inventory_description, Inventory.Inventory_stock_count, nz((SELECT Sum(Order.item_qty) AS SumOfitem_qty FROM [Order] WHERE Order.From_date<=Date() AND (Order.To_date)>=Date() AND Order.Item_ID='I' & Inventory.Inventory_Id),0) AS CurrentlyOut, [Inventory_stock_count]-Nz((SELECT Sum(Order.item_qty) AS SumOfitem_qty
I have this generic routine that I wrote that takes a list of sql strings and executes them against the database. Is there any way I can make this work faster? Typically it'll see maybe 200 inserts or deletes or updates at a time. Sometimes there is a mixture of updates, inserts and deletes. Would it be a good idea to separate the queries by type (i.e. group inserts together, then updates and then deletes)?I am running this against an ms access database and using vb.net 2005.
Public Function ExecuteNonQuery(ByVal sql As List(Of String), ByVal dbConnection as String) As Integer If sql Is Nothing OrElse sql.Count = 0 Then Return 0