Variable Declaration - Signification Of Question Mark?
Jul 8, 2010I was looking at some existing code and stumbled across a variable declaration I didn't understand.
public foo as Boolean?
What does the question mark signify?
I was looking at some existing code and stumbled across a variable declaration I didn't understand.
public foo as Boolean?
What does the question mark signify?
In this
Dim [end] As Point = e.Location
what is the significance of the [] 's?
I have the following form[code]...
and when I run my app, I get a SQL error that tells me that I need to declare a value for '@payperiodstartdate' but I know that that value is declared because the first query runs fine. I am told that the line where the error is is line 59, which is this line [code]...
I'm working on a home project using DirectShow.Net. to learn some VB.net. Most of the examples I've found have all been in C# so I'm looking through code for ideas and converting where I need to. I keep stumbling upon these declarations and I'm unsure how to convert it to a VB.Net statement.[code]Then the second part seems to be assigning the value but as its made up of two parts im unsure how that works?
View 2 Replies[code].....
View 4 Replieswondering about the relatively efficiency of declaring oop variables in the loops, emselves, or declaring them before first use. Here are some examples:Declare early:
Dim ix As Integer
Dim currentNode As System.Xml.XmlNode
For ix = 1 To 100
[code].....
I have noticed in VB.Net that most Dim statements also include an assignment. Eg:Dim myvar As String = "Hello World"As this wasn't possible in VB6 I have always done the following:
Dim myvar As String
myvar = "Hello World"
For i As Integer = 1 To 10
Dim j As Integer = 10
Next
now my question is, Is memory allocated to j every time its executed inside for loop? or only value of 10 is assigned on subsequent iterations?
im sure im mis-wording the concept but here it is anyways. I know in CSharp you can do
el.AppendChild(new UISize(file, "TSize") { CX = 95, CY = 20 });
which declares a temporary bucket variable and then assigns the associate property values to the variable. Which then sends it to the XMLElement AppendChild method. What is this design concept called? What is the conversion to VB.Net? I have tried using my own online utility that does a 90-95% conversion rate from C# <-> VB.Net. It has failed in this instance, and so need a hand-up on what i am looking to do to convert this from C# to VB.Net. I would really like to not have to do a long-declaration of a variable with assignments, if at all possible.
I'm making a call to my DLL file (prototyping 30+ functions), and want to be able to switch between different versions of the DLL quickly while in development. Thus, i want to replace the literal string constant that follows the "Lib" key word, with a variable string constant. In case there's any confusion in my use of the jargon. I am currently able to do this:
[Code]...
How could I create declaration(event) to a variable control in VB .net ? [code]please i need to know how to insert this (declaration) newweb_ DocumentCompleted it's similar to WebBrowser_DocumentCompleted but it's a variable
View 5 RepliesWhen I scroll down to the function shown below, and right click Analogues - go to definition it takes me to the top of the file, and lands on top of the
[Code]...
I've been programming for many years in many languages and I've seen the variable declarations conventions change. With VS 2010 I've noticed you don't have to declare the variable type. I work alone so I can use any method I want. But, someday I may want to sell some of my code so I would like to keep my programming conventions current.
In VS 2010 which of these would be considered the best convention?
Dim srtFirstName = "Bob"
Dim strFirstName As String = "Bob"
Dim FirstName = "Bob"
Dim FirstName As String = "Bob"
Why are static variables set equal to 0 in the declaration when 0 would be the default value of the numeric variable anyway when it's first declared? Not including the "=0" in the static declaration seems to work with no problem.
View 2 RepliesI got problem regarding declaration of dynamic runtime array declaration Here is my code
[Code]...
I have a POCO object and I want to mark a property as a key (see TestClass below).I'm getting the following error. 'Key' cannot be used as an attribute because it is not a class. C:UserszzzDocumentsVisual Studio 2010ProjectszzzzzzBOTestClass.vb
[Code]...
I want to use a value that is pulled from the SQL within the if statement. Ideally i want to do the equivalent of <% If DataBinder.Eval(Container, "DataItem.BookID") == 1 Then%> Is there a way to do this with the correct syntax?
View 2 RepliesThe numbers that get displayed are beyond the 2000. How do I write the code to only display numbers up to 2000.
Sub Main()
Dim iNum1 As Integer
Dim iNum2 As Integer
[code]......
Is there an ability in VB.NET to deprecate code?I know that in C# there are 'attributes', and tags in java; is there anything similar in VB.NET, other than leaving a 'todo:...?
View 3 RepliesI have a program that takes data from text boxes and exports them to a text file (all of this works). the problem I'm having is how do i mark the file for deletion? I couldn't find a tutorial on it.[code]
View 1 RepliesPossible Duplicate: Place watermark image on other images (C#, ASP.Net) how to add water mark to a photo during uploading in asp.net ???
View 1 RepliesI am trying to create an HTML email with an attached image using asp.net VB.
The trouble I am having is that the image is stored as binary code in a table rather than on the server.
I have the following code:
Dim myHeader As New LinkedResource(Server.MapPath("/Handler.aspx?id=237"), "image/jpeg")
I know it's the question mark in the path that's causing the problem. Does anyone know a way around this??
I have a DataTable which I want to check if values in three of the columns are unique. If not, the last column should be filled with the line number of the first appearance of the value-combination.
[Code]...
I solved this by iterating the DataTable with two nested for loops and comparing the values. While this works fine for a small amount of data, it gets pretty slow when the DataTable contains a lot of rows.My question is: What is the best/fastest solution for this problem, regarding that the amount of data can vary between let's say 100 and 20000 rows? Is there a way to do this using LINQ? (I'm not too familiar with it, but I want to learn!)
I have created a few WebRequest extension methods that support cancelling. Is it possible to mark related .net framework methods as Obsolete. That will allow other developers to get warning and encourage them to use a new extension methods.
View 3 RepliesIn my application I have bound a datagridview to a SQL2005 bindingsource.I really had to change a database field (more length allowed) and now de DGV displays red exclamation marks and states: 'Colomn 'password' exceeds the MaxLength limit'. (the 'password'-colomn isn't even displayed, but that's a sidenote).I tried different things but can't get rid of the exclamation marks. how I can manage this. I really don't want to create a new DGV, because there a lot of code and stuff involved.
View 2 RepliesPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Response As Integer
' Displays a message box with the yes and no options.
Response = MsgBox("Do you really want to exit?", Buttons:=vbYesNo)
[Code] .....
How do I place that blue question mark symbol next to "Do you really want to exit?"
I'm trying to search a picture from a color or a color close to the original color and then mark it in the picture if it is in the picture. How can I do this?
View 13 RepliesLets say I have opened image on the screen. I want to find coordinates of little object on that picture. I know pixel pattern of that object.
[Code]...
What would be the easiest way to have a NumericUpDown control showing a double quote " after the value? It's to represent a distance in inches.
From MS Word:
I am encountering a problem. I want to write a string into a text file, and string is:
[Code]....