When working with PHP I always declared my string variable and set them equal to null just to be safe. I'm new to visual basic and am wondering what the safest way to declare a string variable is. Will
Dim strWords As String
be sufficient? Or is it better to set it to null or nothing or some other default value or primitive type?
Is it possible to declare a variable using the text of, lets say a string, as the name?If u dont get it im looking for something like;Dim Var + string1 As PictureBox..In the code "Var" is the start of the name and "string1" is the end of it so if string1 was "Hello", the picturebox would have been named VarHello.
I have a form with 2 controls, a textbox and a button. The user will type text into the textbox and then when they click the button the text that they entered will be added to a List Collection. You can see the code below. There is just 1 problem. Where would I put my declaration of my List Collection so that it holds the values and does not start at the first element everytime the button is clicked?[code]
I have been debugging my code for a while and looking at posts in other forums, but it seems to be that everyone has a different problem than mine and what works for them will not work for me.My dropdown list is supposed to filter a gridview by choosing all the Companies that are associated to a certain product. The solution I have found online is that most people did not have DataKeyNames set in their gridview. I do have this set, but not to CompanyID. It wouldn't make any sense. So I have no idea what I am supposed to do since this is the only answer I have found.
How do you declare a variable as a Date and initialize it with a date before year 1. I would like to caluate historical BC dates using a fuction that returns the ellaspt time.
I've used this line of code however I can't to work setting the date value to a negative.
I have searched online for a few hours to try to figure out how to do this, but nothing I found really makes sense, so could someone please tell me, in a simple way, how to do this?
Let's say I have a text box that the user fills out, named textbox1. And I have a combo box, named combobox1, which contains the choices A, B, C. And then I have a button named submit_button.
Each time that the user clicks submit_button, I would like to dynamically create a new variable. This variable should be named the same as textbox1.text, and should contain the value of combobox1.
For example, if the user types "blue" into textbox1, and chooses value "C" from combobox1, and then clicks submit_button... then the following variable should be dynamically created, like..Dim blue as String = "C"
And then, after that, if the user types "red" into textbox1, and chooses value "B" from combobox1, and then clicks submit_button... then another variable should be dynamically created, like...
Dim red as String = "B"
And each time the user submits new information into the textbox and combobox, a new variable should be created.Is it possible to have the program automatically create variables like this? If so, how?
My actual project is much more complicated than this, of course, so the above is just an example. But if I could figure out how to solve the problem in this example, I could figure out how to solve the entire project.
I'm trying to make a message box appear, I don't want to have to declare the message box as a variable, And I don't want it to be in it's own Sub!I just want it to print (variable) S, It's in a sub. Just not sure of the structure of that code. Just a really quick example
I am working on an alarm system software, which is SMS-based. I am using a GSM modem to receive the SMS when a client's premise security devices are triggered. The types of SMS text received will be like for e.g. "fire alert"(when devices triggers), "fire clear"(when devices are 'reset').
My program can detect real and false alarm, it works this way, i will input a premise site-map on a picture box at the main GUI, i can then create buttons at run-time and drag them to the respective position on the map. The buttons created have their text set as the client's block number referred to the database. So basically, a button represent a client. When a device in the client's premise is triggered, a SMS will be sent and my GSM modem will receive it, process the SMS and the button representing the client will start 'flashing' showing that the client's premise is under danger. Then when the button is clicked, which acts as an acknowledgement, will display the client's information on labels and turning that specific button to red color. Finally, when the device is 'resetted' in the client's premise, it will send another SMS to my GSM modem, after processing, the button will be back to normal.
But my program has detect false alarms also, the first part is similar to mentioned above, client's premise security device triggers, SMS sent, SMS received by GSM modem, process SMS, button 'flashing'. Secondly, if the alarm is false, it will be automatically 'resetted' or the client may 'reset' it, then a SMS will be sent to my modem, turning the button to 'flashing' green in color. when 'acknowledged' will display the client's info and the button will become normal.
The problem here i am facing is during the processing of the SMS, because the real and false alarms both will receive the 'clear' SMS when during some stages, but the functions are different and of course the 'checking' for both functions will be different too. The problem occurs at the checking process whereby the 'btn' variable is not detected.
'Try 'AT commands to receive SMS serialPort.Write("AT+CMGL=""REC UNREAD""" & vbCrLf) 'set command message format to text mode(1)
Later on i have a form where a cost for a class is calculated by timing the duration of a class by the costperhour textbox which is in a different form.
This seems so basic but I've been struggling to find a solution! I have a web page that take user data from aspx textboxes. Upon hitting a button, the click event submits the responses to a SQL table. Seems easy.I'm using VS10, dev express and VB code. I have established my datacontext class using LinqToSql...In a nutshell, the code is as follows...within the click eventNote that "database" was earlier defined as my datacontext sql connection, "Request" tablee
Dim vname As String = AspxTextbox1.Text database.executecommand("INSERT INTO [Requests] (ContactName) Values (@vname)")
im having this prob, when deleting a line from my gridview, this error shows out.Must declare the scalar variable "@productid".Well, i dont know whats wrong with the coding. As i have already declared the productid.
vb.net Public Class UniQueGlobalConnector Public GlobalConnection As New OleDb.OleDbConnection Private Sub OpenConnection() Dim UniqueConnectionName As String = "GlobalConnection" & (Rnd(10)).ToString.Replace(".", "_") Dim InternalConnection As New OleDb.OleDbConnection GlobalConnection = InternalConnection
What I am trying to do, is perform some edit checks on required fields in my page. When the "Submit" button is clicked, I wish to check execute a javascript function that does these checks.
The way I'm envisioning it is to declare a server-side variable in my VB.Net code-behind, set this value in the javascript CheckEdits() function and then back in the code-behind in the btnSubmit_Click() Event, check this variable.
I need regarding declarations of global variable.. I created a module here is the script.
[Code]...
and then I set the value of that variable in my Login form and then my PROBLEM is when accessing it on the my Main form and I want to display the data of that variable in a textbox, the variable does'nt hold the value that I already set. I'm waiting for replies!
How can I create a DLL declare statement with an environmental variable in it so as to make sure that I'm loading the system DLL from the right place, the system32 folder? For instance...
Declare Function GetExtendedTcpTable Lib "iphlpapi.dll" Alias "GetExtendedTcpTable" (ByVal tcpTable As IntPtr, ByRef tcpTableLength As Integer, ByVal sort As Boolean, ByVal ipVersion As Integer, ByVal tcpTableType As TcpTableType, ByVal reserved As Integer) As UInteger
The reason I'm asking is that there has been talk about people injecting invalid/malicious DLLs into folders along with applications and whatnot and I see this as an issue if you don't specify the SYSTEM directory. Yeah, I could specify it to load from c:windowssystem32 but what happens if a person doesn't have their Windows installed in c:windows? Hence the reason to use an environmental variable to find system32.
How can I define the datatype of an variable dynamically. I read out data from a file. In the file it is specified, if the raw-data is interpreted as single, integer or .... So my idea is: To check, what datatype is in use and then declare an array with this datatype to store the data there.
I have been working on a homework assignment and I am having problems with it. Okay here is my final code. I declare a variable that is not used yet. I am wondering if I need to use the index to somehow fix this issue with the consonants. Maybe I need to nest another if, then or do some kind of comparison to figure out if the word begins with a consonant then tell it to move the consonants to the end
'you know something like this below, but this is not my final code yet: determine if origninalWord begins with a consonant determine how many consonants there are before you reach the first vowel If originalWord begins with 1 consonant
[CODE]...
But I do not know the proper way to code the begining in red color text the last two sections work for vowels and numbers. Here is my new code.
Code: 'Gail Amalfitano 'date modified: April 1,2,4,5,6 (date created 3/27/09)
'This program is for converting words or strings to pig latin. The user enters what they want converted,'hits the converter button and views the pig latin version of their entry.
Option Explicit On Option Strict On Option Infer Off