VS 2005 Declare Dynamic Variable (names)?
Dec 7, 2010
I'm looking to create multiple variables based on a counter object. For example if a counter object is 6 I want to create 6 instances of the variable mText
Something like:
Dim i as integer
Dim Count as integer = 6
[code].....
View 1 Replies
ADVERTISEMENT
Sep 5, 2011
I am doing work for a client who has lost the source code for one of their VB.Net WinForms applications. The assembly they have is not obfuscated at all. I am trying to recover as much of the source as I can as C# source and have tried several tools for decompiling assemblies, including Reflector, ILSpy and JustDecompile (all the latest versions), but they all produce code with a huge number of errors in them. Because of the large number of errors in the generated code, I am going to ask about the specific errors (in different questions), get more directed answers and in this way try shed some light on why all the tools are having difficulty decompiling this assembly. This question pertains to the fact that the code generated by all these tools always have a large number of invalid member variables (fields) such as the following:
private short $STATIC$Report_Print$20211C1280B1$nHeight;
private ArrayList $STATIC$Report_Print$20211C1280B1$oColumnLefts;
private StaticLocalInitFlag $STATIC$Report_Print$20211C1280B1$oColumnLefts$Init;
why the generated code has these invalid member variables?
View 3 Replies
Nov 13, 2009
I have situation where I read a source file, create a temporary text file of the source and modify the temp file. If I open the file twice it appends to the end of the first temp file even though Ihave StreamWriter append set to false. Only if I close and reopen my application does it not append. It like there is buffer or something not getting cleared.Below is the syntax I'm using.
If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Using objReader As New IO.StreamReader(OpenFileDialog1.FileName)
[code].....
View 1 Replies
Dec 2, 2009
What's the C# equivalent of
<% dim name %>
so you can use it for web forms in PayPal API integration?
View 3 Replies
Feb 6, 2011
why don't we declare a variable for instance variable with dim not private?
View 3 Replies
Mar 11, 2012
Each time it runs, a program of mine creates an Excel document and names it using the current date ("Alerts from 29062011.xlsx" for example). The program gets run once a day,every day.The users have requested that I have the program delete the previous days Excel file each time it runs so that they don't take up space. I'm unsure how to do this though since, for example, if it is run on the first day of the month it would have to know
View 6 Replies
Sep 21, 2010
im trying to create smarter more efficient code in my project by having all lables change to their desired states by use of a for loop. currently my labels are all something like lblB1. can i do anthing like the following?
[Code]...
View 9 Replies
Jun 8, 2012
My question is how best to avoid SQL Injection with the method I am currently using.EDIT (Reasoning): There are many of columns in a number of tables (a number which grows (only) and is maintained elsewhere). I need a method of allowing the user to decide which (predefined) column they want to query (and if necessary apply string functions to). The query itself is far too complex for the user to write themselves, nor do they have access to the db. There are 1000's of users with varying requirements and I need to remain as flexible as possible - I shouldn't have to revisit the code unless the main query needs to change - Also, there is no way of knowing what conditions the user will need to use
View 2 Replies
Jan 24, 2011
I want to know if it is possible to declare a variable thrice.
[code]...
View 1 Replies
Jul 21, 2009
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]
View 5 Replies
Jan 29, 2009
I need to iterate through controls using dynamic construction of control names and it looks like this could be what I need, however I never used this before and it does not quite work. What am I doing wrong? GroupBox1 is what I am attempting
Dim x as Integer = 1 For Each ctrl As Control In CallByName(Me, "GroupBox" & CStr(x), CallType.Method).Controls The runtime error is "GroupBox1" not found on Form1 even though I can select Me.GroupBox1 from the dropdown list.
View 14 Replies
Oct 21, 2011
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.
<asp:DropDownList ID="ddlCompany" runat="server" DataSourceID="dsCompanyFilter"
DataTextField="CompanyName" DataValueField="CompanyID" AppendDataBoundItems="true"
AutoPostBack="true">
[code]....
View 2 Replies
Apr 1, 2009
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.
Dim
myDate As Date = CDate("2/6/1400")
View 2 Replies
Mar 18, 2011
why we can't declare a variable on some class such as math
for example?
dim s as new math
?
but we should imports them..
View 17 Replies
May 9, 2012
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.
View 6 Replies
Jan 21, 2012
I can declare a variable in VB.NET that stays even after closing and re-opening the program?
View 2 Replies
Dec 7, 2010
What i am trying to do is this:
Dim Name as string
Name = "Bob"
Dim Name.tostring as Integer
Which will create as variable called Bob of type integer.
But obviously this code doesn't work. So what is the real way to do this if it can be done?
View 2 Replies
Nov 11, 2010
how to declare out global variable? i tried out but get error.. below is my orginal code
[Code]....
View 1 Replies
Jan 7, 2011
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
View 1 Replies
Mar 17, 2009
What's the main problem if I don't declare the type of a variable? Like, Dim var1 versus Dim var1 as Integer.
View 6 Replies
Nov 18, 2009
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)
[Code]....
View 1 Replies
Apr 23, 2012
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.
View 3 Replies
May 11, 2010
the error is pointing at : objAdapter.Fill(objDataSet, "placename")
the following is the code that is throwing an error.
Dim selectedname
As
String = "boston"
[Code]...
View 6 Replies
Jan 9, 2012
Must Declare Scalar Variable @ID?
View 11 Replies
May 16, 2012
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)")
[code].....
View 8 Replies
Apr 6, 2010
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.
<table style="width:100%;">
<tr>
<td class="style24" colspan="2">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
[code]....
View 2 Replies
Oct 9, 2011
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
[Code]...
View 3 Replies
Jan 1, 2012
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.
View 5 Replies
Jun 21, 2010
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!
View 2 Replies
Oct 25, 2006
How can i declare a static variable as global in vb.net?(Global static variable)
View 5 Replies