i am running a Sub which takes as arguments a Datatable and a String.
Private Sub Populate(ByVal dttemp As DataTable, ByVal strWhichPart As String)
At one point there is a combobox which is populated with some of the data in the datatable. The name of the combobox is cmd plus the name of the string for example when the string is Person_FirstName the name of the combobox is cmbPerson_FirstName.Then i add items to the combobox like this:
cmbPerson_FirstName.Items.Add(strHold(rr))
My question is this can i make a String into a command? Because i have many comboboxes which have the same name as the string argument of the sub how can i do something like this to work
strWhichPart.Items.Add(strHold(rr))
in which strWhichPart is a string. Is there a command that i can execute a string as a command?
Is there a way to use the string.split command to get a section of a string without using an intermediary array?for example, if my string is "1 2" and I want to get the "2" part using string.split(" "), is there a way to avoid creating a new array, and just get the bit of the string I want in a single line?
I seem to be getting an error SQL command cannot be converted to string with this code
Dim LogData2 As sterm.markdata = New sterm.markdata() Dim query As New SqlCommand("Select * from openquery (db, 'SELECT * FROM table WHERE person=@person')") query.Parameters.AddWithValue("@person", Session("number"))
I am trying to make a calculator (how original) but I am also trying to make it like a console. I have a textbox in which you enter a command and a list in which the lines appear.
My question is how can I translate the plain text which the user enters i.e 3*(2+4) to a maths command so that VB can display the answer?
In the following code i want to replace 'Product7' (in the line : sql = "delete product where Product_name ='Product7'") with a string variable: dim x as string x = "example" how to do it ?
Imports System.Data.SqlClient Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connetionString As String [Code] .....
This question may have been asked before but I searched around a lot and I couldn't find the solution of what I need.Let's say I have a string like "Int(100/9)". How can I get the result I want, which is 11? I don't believe the MSScript Evaluate method would work on this one, would it?
I have an application where the user and search the database and return the values from it. They can also figure the Average, Median, and the Standard Deviation from it. BUt I have a problem with this since the business rules won't allow the result column to be anything but a string so now I am getting error messages on the Select commnad text since it is trying to perform the calculations. I am wondering if there is a way to convert the values in the command text to a numeric value then perform the calculation. Here is the code I am using at the moment.
I've been using SQL OleDB commands to grab data from some excel files and it's working well, but I'm having a really hard time finding a good resource for the actual command strings on the web. I figure I must not be using the proper terminology in my searches. Take this line:
Dim da as New OleDb.OleDbDataAdapter("Select * From [" & sheetName & "]", Conn)
My question this morning was: Can I pass a command that will grab all sheets from the excel document instead of just one in particular?
I have a problem with the code below as a SQL command string. Note: Using .Net Framework 4.0 in Visual Studio 10 Professional. Database is a Microsoft Access file. The idea is that this SQL command string will update a password within my database. Also note that I have tried the string below with and without the ";" at the end and it does not work either way. The problem is most likely extremely obvious, but I can't seem to find it. I have commented below the code what each part of the String is.
"UPDATE Users SET Password='" & tbx1.Text & "' WHERE Username = '" & sUsername & "';" ' Users is my Table name within the Database. ' Password is the field that I want to edit within the Users table. ' tbx1.Text is where the password is stored within a text box. ' Username is the field which I would like to compare with sUsername which is a variable within the code.
Solution was square brackets, Command string now looks like this: "UPDATE Users SET [Password]='" & tbx1.Text & "' WHERE [Username]= '" & sUsername & "'"
I'm working with an eprom emulator in trying to understand the command string write instructions. Here is what I have. [code] From what I know, the values in hex need to be converted to decimal first. What I'm not sure about is the checksum value needed. The instructions say Checksum =(1 byte truncated addition of all the above).
[code]Myself and a coworker have stared at this quite a lot and we can't figure out why it's not working. The problem is in the value for @ID (since it still works when I leave the other one parameterized). The funny thing is, Just a few lines of code above it I have a different query that sets a parameterized value for the same ID, using the the same choices list that the For Each loop is getting the match variable from.Choices is a list of longs, and when I use choices(0) to parameterize ID in a query, it works. But now down here in this loop I have the new match long, and it doesn't want to make it work for me.
First let me say that I am not sure whether or not this should go in this section or the API section, and if it needs to be moved I apologize. My issue is fairly straight forward, but for some reason I cannot get it to work.
I am trying to send a command to a command line and then submit the command. I have been trying without success to get this to work in v2008 Express and v2010 Express, Here is the code I am trying to us:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String _
I want to upload a string using the UploadString command to a Text file on my FTP server, It uploads correctly but everytime I have the user submit a new string, It overwrites the previous one and displays only one line of string.
I want the person to be able to Submit one string to the text file, then when another user submits another string ( A new line of Chat ) to the text file, I want it to be on a different line after the previous one submitted. Without it being overwritten.
Here's the code I have so far.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'button is called Out.
i tried to change back color of a label by command button by using a variable value
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim colorof As String colorof = "Color.Red"[code]....
but its giving error and is not working,
Label1.BackColor = Color.Red is working but I wanted to do this with variable value
I have an Access table in which I connect through ODBC commands. I want to delete the 50% of data rows from it. Can anyone knows a string to write for doing that? ALARMLOG is my table. In MS SQL I tryed succesfully the following command :
I am currently using psexec.exe from PsTools to send a command to a remote system to fire a command through a command prompt however I am finding that the shell I am doing does not seem to like the spaces in the path.
Any ideas on how I handle the following error thrown in the SqlDataAdapter.Fill as a result of the BeginTrans in the callee?
System.InvalidOperationException = {"ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction.The Transaction property of the command has not been initialized."}
I want to add a new select command to my dataset. To do that, I have added a new partial class to my project. Because we have to use partial class if we want to extend generated dataset codes. [code]...
I am using a CheckedListBox that is populated with Filenames (full path, i.e. C:TestTest.jpg)When I have the files that I want in the CheckedListBox I wish to click a Start Button which will process the list one at a time using an exe program that runs on the Command Line. There are arguments that need to pass to the command line as well as the file location in order for the program to process.I currently have it working but the issue is the loop finishes quickly and it is left up to the CMD.exe to finish the process. What I would like is for the LOOP to wait until each file completes processing before passing the command for the next file in the CheckedListBox.There some reasons I wish for it to work this way.
1) I would like to have a button that can Pause/Restart the Loop.
2) I would like to have a button that can Stop the Loop so the whole process can end.
3) I would like to have the Loop remove each file one by one from the CheckedListBox after it has been processed.
4) I would like to display a Message once all the files have been processed.
5) And if it were possible I would like to report the status either by text or a progress bar showing where it is at in the process.
6) And the ability to add some error handling if possible.
Since the Loop finishes so quickly as it just passes the command to the command line using the & as a seperator it is the command line that is handling the rest of the process. Because of this there is not control over it in the GUI.The code I am using allows the Command Line text to display in the Form so it won't open up a seperate window to run CMD.exe. This is the desired affect as I would like everything to appear to run from within the Form itself.