Adding Parameters To Sql Command?
Dec 1, 2009
I am running visual basic 2008 express. When I run the code that I have written it gives me the the following error message
- Incorrect syntax near '?'.
Does anyone know what causes this error. My code is as follows -
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.OleDb
[Codee].....
View 9 Replies
ADVERTISEMENT
Feb 10, 2010
I have been working on this all day and still haven't had any luck at getting it to work. I am using the SqlDataReader Object to retrieve data. I am using the code below to send a value to the stored procedure.The problem is that the value is sent enclosed in quotes so I dont get any data back. I have tried using .text.replace("""","")
View 9 Replies
Oct 16, 2009
i am running a dos command. now i created checkboxes to add parameters to the command. [code] but it only gives me a 1 or 0 but i want the parameter -h, -t, -v when the checkbox is checeked.
View 10 Replies
Apr 7, 2011
I am passing some comma separated parameters to console Application. I want to split those string for that I have written below script but it is giving error .
static void Main(string[] args)
{
Console.WriteLine("Command Parameters :" + Environment.CommandLine);
[code].....
View 2 Replies
Sep 9, 2009
I am trying to setup a variable in VB, which will execute a shell command (autostatus.exe) with a parameter (-j JobName), and later display the output of the said variable. The code thus far is...
Dim JobName
Dim JobStatus
JobName = "asysr11_set_global_var_2day"
JobStatus = ShellExecute("autostatus.exe", -j, JobName)
What is the easiest way to achieve this? Currently, the above code returns error message "line:4, Type mismatch: 'ShellExecute', code: 800A000D"
View 1 Replies
Dec 23, 2009
as i need add the two commandline parameter on debug window.
/url=
one is okay
[code].....
View 2 Replies
Nov 4, 2009
I don't know where the extra character 'N' is coming from, there should only be one parameter coming from my SP which is the ID:
cmd1 = oStringConnection.SetCommand(sqlConnectMain, _
cmd1, "TestStoredProc", _
DBConnections.myType.cmdAsProc)
[code]....
When I ran the SQL Profiler, I found this:
exec TestStoredProc @StudentID=N'12345'
View 2 Replies
Mar 5, 2009
I'm currently creating a new process and then executing an executable from a specified location:
[Code]...
View 4 Replies
Nov 3, 2011
I use the following VB code to execute a scalar function on my sql server:
cmd.CommandText = "[STFRA].[dbo].MyScalarFunc"
cmd.Parameters.Add("@Fastener", SqlDbType.Int)
cmd.Parameters("@Fastener").Value = 4148
[code].....
View 2 Replies
Mar 2, 2012
I'm rewriting a small application and I'm working on moving the data access logic from the form to a separate class. All was working will when I had all the code in the form. Lets say I had code similar to this in my form:
[Code]...
View 3 Replies
Oct 29, 2009
I would like to create a console program in VB.net that would allow parameters. What i would like to do is in the code below add parameters so the webpart page can be created from the Run menu. e.g. C:.......MyProgram.exe "Design" --This would then create the Design webpart page.
I tried looking at the internet but was not very successfull.
Module Main
Public Sub Main(ByVal args As String())
Dim prj As String
[Code].....
View 1 Replies
Mar 18, 2009
I need to give an app 2 string values on startup via the command prompt like this
C:myapp.exe string1 string2
How do I accept these values?
View 5 Replies
Dec 8, 2009
how to send a procedure call to a Command Button.
What I would like to do is have one button be able to call any number of other sub routines when needed. In other words...the app is running and I need it to stop so the user can either read information presented...or make choices...then click the CONTINUE button to pick up where the app left off. However, I need this to happen many times across several forms and modules.
I know I can use a MessageBox and get the same effect..
View 5 Replies
Sep 28, 2010
I have a stored Procedure
CREATE PROCEDURE sp_DescriptionLookup
-- Add the parameters for the stored procedure here
@manfactureid as int
[Code].....
View 1 Replies
Oct 2, 2009
Currently working on a web-service with Oracle10g as back-end. Here is my problem.
1. The table I need to populate has 100 columns. I have no control over the design of the table.
2. I wanted to use the "deriveparameters" method of OracleCommandBuilder, but found out that this is "costly" in terms of performance. What I initially planned to do was to derive the parameters from an open connection, close the connection, then maybe cache the parameters obtained but I don't know if this is possible.
I am unsure how big of a hit the performance will get if I continue using the "deriveparameters" method WITHOUT caching the parameters driven. The environment is as follows
-intranet
-around 2000 users
-users spread out in different parts of the country
I am not familiar where they will put the web pages of the application, the web service and the database. I don't know if they'll be putting it in different servers or on one server, but that's something we cannot control too, that's why I am looking for the best approach.
I just don't want to hard-code all that parameters and if, for instance, we need to change some properties/parameters, it will be a pain to maintain the code. It would be nice if someone here can point a way to automate the whole thing w/o the performance of the system taking a hit.
View 3 Replies
Mar 31, 2011
I've got a program where the insert/update SQL was created with the values coded directly into the SQL string. I've changed this to use the Command's Parameters.AddWithValue method and all worked well. I'm now in the process of separating the data access code out into it's own class. I've got the Select code working using a DataSet in the form that I pass ByRef to my data class so it can populate or refresh it. My sticking point is in how to pass the parameters for the Insert/Update commands to the class since from the form I no longer have access to a Command object. Do I need to make the Command object in the data access class available to the form?
View 6 Replies
Jul 3, 2009
I am trying to execute a command line EXE (busobj.exe) with required parameters through VB.Net. Because of unknown reason the report is not being generated. Here's the commandline:
Shell(txtBOExecutable.Text & _
" -user " & txtUserName.Text & _
" -pass " & txtPassword.Text & _
" -system " & txtDomain.Text & _
[code].....
View 5 Replies
Feb 17, 2010
I am in great problem regarding adding new parameter in parametercollection. the code is below [code]but here a erro given that is "Variable osqlParameters is used before it has been assigned a value, a null reference exception could result at run time"..
View 4 Replies
Feb 2, 2010
I want to add a parameter to my thread call here is the code. I want to call th.Start(True, sender.Text) and Count(ByVal isRunning As Boolean) will then become Private Sub Count(ByVal isRunning As Boolean, Byval strID As String), but I can't do that. So how can I make this thread accept 2 parameters?
Private Sub btnStart1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart1.Click
th = New System.Threading.Thread(AddressOf Count)
th.Name = "Button1"
th.Start(True)
[Code] .....
View 4 Replies
Mar 21, 2010
How to add parameters to app.config file while during msi file installation. please look at the attachment.
View 12 Replies
Jan 3, 2012
Module Code
Imports System.Data.OleDb
Module modConnections
Public myConn As New OleDbConnection
Public myCmd As New OleDbCommand
Public MyDr As OleDbDataReader
[Code]...
View 21 Replies
Apr 13, 2010
Module Code
Imports System.Data.OleDb
Module modConnections
Public myConn As New OleDbConnection
Public myCmd As New OleDbCommand
Public MyDr As OleDbDataReader
[code]....
View 6 Replies
Mar 20, 2009
How do you use MSI to add command line aruments to an application?I am trying add command arguments that will be processed by the application when it starts.I know how to retrieve them;I don't know how to add them.
View 9 Replies
Jun 7, 2012
In a Windows Form project (using VB Express 10), is there a way to use a second command line arg (first one is in a module1 for start-up that checks another command line, and if correct, runs app)? This second command line would be used to close the open app (including all forms)? (I already have set up a Module1 to recieve a command line to run the app. This would be a second command to close the running app.)
I am opening the WF app using another app (created in a different software) that can pass command lines. So, if in that other app, I send "close" as a command line arg, how do I set up the WF app to receive this specific "close" command and perform Application.Exit()?
As a beginner using VB, not sure where it would go, how to declare, etc.
View 10 Replies
Jun 2, 2011
Any way to add command line arguments to my application so that if someone wants to modify the settings they could run myexe.exe /settings and get the settings form of my application.
View 2 Replies
Jan 20, 2010
I have 14 command buttons on my form. what i want to do is change the text of the form based on the current date. button1 should have todays date.button2 should have tommorows date.button3 should have day after tomorrows date and so on. I want this for fourteen buttons.I can do it manually by assigning each button.text to each date... i want to do it using a loop. is it possible.my buttons are named , button1,button2,button3,button4, and so on toll button 14.and the text i want on them is from the current date to 14 days later...basiocally want to display the dates on the button..is it possible though a loop.m using visual studio and vb.net
View 5 Replies
Nov 15, 2011
I have a visual basic shell command that installs an IPP printers with a shell command. It asks for the username for the port.
userport = username.Text
How do I Incorporate that into:
Shell("rundll32 printui.dll,PrintUIEntry /b ""AT-LAB-BWQ"" /if /f %windir%inf
tprint.inf /r
""[URL]"" /m
""HP Color LaserJet 2800 Series PS"" /z /u")
View 3 Replies
May 11, 2009
Is it possible to add custom command in a shortcut (.lnk) menu (right button) through .net? How can i add the command and executed that command.?
View 4 Replies
Jul 5, 2010
I found that if using ArrayList, all clone/CopyTo/Add command are shadow copy, not separate copy. How can I do such that after an ArrayList A is "copied" to ArrayList B, change in ArrayList A will not reflect to ArrayList B?
View 1 Replies
Mar 23, 2010
ok, i've been able to figure out that i can add a button to a menubar (like the file edit view, ones at the top of most programs) and so far i have figured out:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
form1.MenuStrip1.Items.Add(TextBox1.Text)
[code]......
View 2 Replies