Setting Parameters Of Command Object Seems To Fail?
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
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
Mar 31, 2009
I have a lambda function that I can assign to a field and pass it to a sub routine, but cannot assign to a property. My field is defined as follows:
Public Delegate Sub SubDelegate()
Private pDeleteFunction As Func(Of BookCaseRow, SubDelegate)
[code].....
View 3 Replies
Jul 30, 2010
I searched around and could not find a solution so I am sorry if I started something that has already been covered. Want I want to do is run a command line code and simply return a boolean of if it was successful or not. Is this possible? Typically when you run something (example net user User Pass) it will return a value "The command Completed Successfully." If I return this value I will have it from there.
View 10 Replies
Feb 12, 2009
im not 100% sure this is the right place for this, but thought I'd give it a shot.I created a windows service, and it accepts startup parameters to set the connection string for my database connection. (-L for live, -D for dev, -S for stage etc.)[code]I installed the service using installutil (I already tried using sc.exe) and I can't specify startup parameters.So if I go into Services and go into my service properties and manually type -D into the Startup Parameters box and hit start, I get -D as my parameter, life is good. But the parameter won't save in the startup parameters box, it just reverts to a blank box whenever I close the properties page.[code]
View 1 Replies
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
Jul 4, 2011
I got this error when trying to use parameters to my sql statement, but it works fine when not use it. My codes are below:
[Code]...
View 1 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
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
Apr 23, 2011
I'm running into the following error message when I click the button event: Command text was not set for the command object. [code]
View 1 Replies
Dec 21, 2009
If I comment out MdiUpdate() this run fine. When I run it with MdiUpdate I get the following Error...
da.Fill(ds,
"Mdi") Command text was not set for the command object.
I have also taken the code from the select statement and put it into the other 2 (replace the CliendGroupID = 3) and it works fine
Here is the code:
Public
Class NewFileInput
Dim inc As Integer
[code]....
View 2 Replies
Jul 10, 2009
have been trying to research the net on the subject of "how to set a folder view utilizing a VB.form button" but I haven't been able to find what I need to solve my problem.Goal:- Click a button on my form.- It opens a folder.- As it opens the folder the view of that folder it opens is set to "details" and the folder is "maximized"
View 3 Replies
Jan 31, 2012
For example if I have a function call like below
Function callingMe()
Exit Function
And my Function call is like below
SomeObj.callingMe('1','2','3','4','5') // Variable number of arguments
Inside callingMe() function, I want to know arguments passed i.e 1,2,3,4,5 and the Object i.e SomeObj in above case.
View 2 Replies
May 1, 2009
How do I add an object with parameters to work with MSScriptControl, example:
VBScript.AddObject("GetNPCHP", NPC.GetHP(byval npc_hp as integer), True)
This doesn't compile.
View 11 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
Mar 22, 2011
I have an object, called 'PERSON' This person object has a title, firstName & Surname property as well as many other which are at the moment irrelevant. It also has a read only property called Fullname which concatenates the two or three parameters mentioned above depending on an optional parameter 'withTitles' passed over when you call PERSON.FULLNAME
PERSON.FULLNAME(true) <- Will add titles if there are any
PERSON.FULLNAME(false) <- Will give the name without the title
Public ReadOnly Property FullName(Optional ByVal withTitle As Boolean = False) As String
[Code]...
I get an error: PERSON does not contain a property of 'FullName'. If I change this to any other property that does not take a parameter it works as expected. Now I'm guessing that the binding procedure can't handle optional or mandatory parameters for object properties, is this right? Is there a better way to do it? I thought about looping through the collection to add them manually but that kinda defeats the object of DataBinding!
View 1 Replies
Feb 17, 2011
I'm currently working with a client's VB.Net code, which was developed for them by a small development shop a few years ago and which they purchased and have been maintaining and uprgrading since. This client's primary developer is out on indefinite (likely permanent) medical leave and I'm now filling in until they bring in a full timer (as I'm a contractor here). My current task is to add some functionality to a the VB.Net code they purchased. I'm finding practices and techniques in the code that absolutely baffle me and can't make the code do what I want. I'm starting to wonder if it's me and was hoping to get some thoughts on the code I've encountered.
For example: Setting a variable to accept the result of a function by calling the function with many parameters, clearing the parameters in the function, setting them to some value, calling another function with those new values, then never using the values returned by the functions. I'll add a code snippet in the first comment since this is already getting long.
View 9 Replies
Feb 9, 2011
Here's the code that is causing my problem, I have no idea why though. All necessary services have been imported.
'Creates Prompt File
Sub CreateFile()
Dim createstring As String = ""
[Code].....
View 2 Replies