Whats The Difference Between (As) And (=) In Object Declaration
Jun 2, 2011if I created a new object like this Dim sqlconn As New SqlClient.SqlConnection(cs)
and Dim sqlconn = New SqlClient.SqlConnection(cs) Whats the difference?
if I created a new object like this Dim sqlconn As New SqlClient.SqlConnection(cs)
and Dim sqlconn = New SqlClient.SqlConnection(cs) Whats the difference?
Is there any way to have 2d graphics that gets made by user through manual dimensions input be bound to a text box?
Is there any way to take position 1000,600 and make that zero? Can we make graphics by inputting only the next co-ordinate and have the pc automatically draw a line from last point?
Also, whats the difference between drawline and draw path? How can I get the shape to remain on screen when I toggle between pages?
The Param1 works but param2 failed when passing it to method with object array parameter
Dim param1() As Object = {5, 5}
'And
TextBox2.Text = "5,5"
Dim param2() As Object = TextBox2.Text.Split(","c)
RichTextBox2.Text = CType(InvokeDllMethod(bt, "kayTestDynamicAssembly.KayTestDLL", "Addup",
param1), String)
My main question is that does .NET treat those 2 declarations differently or maybe I am missing something?
I am using Visual Basic Express 2008 to make a simple game. I am trying to declare a dataset object and datatable but I'm getting a bizarre syntax error and I can't find a help reference.
Line A - I dimension GameTable as an Object
Line B - I instantiate the object
Line C - I edit data in the GameTable
Line D - I display the data in Visual Basic
Line C will crash in runtime if I don't do sometype of "New" declaration
Line B is my attempt at a "New" Declaration by I get an error message I don't understand - "Type Expected" - I think I have the syntax wrong here.
[Code]...
The last line in the code below throws the error. Is it because I haven't intialized the size of the byte array?
Public Class Form1
Private toSocket_IPP As Byte()
Public Sub New()
[code].....
In the following two code snippets, the code does the same thing, when I tested this.
Dim test As New Class1 Dim test As New Class1() Do the parantheses make a difference in some way? Is there an explanation of this in the msdn library?
[Code]...
I am getting an error in above line says: objrpt is not declared it may be inaccessible due to its protection level I agree it may be inaccessible if the condition doesn't met - but here if it doesn't met it will take CrystalReport2 know ?
I got problem regarding declaration of dynamic runtime array declaration Here is my code
[Code]...
If I create a class in VB called Test,I noticed I can instantiate it like:
Dim test As New Test
or
Dim test As New Test()
What is the difference?
I want to know the difference. I have given 2 lines code.
CODE:
Let me know difference between both datatype.
Dim MyOrders As Order()
Dim MyOrders2() As Order
I'm using vb10. I need to use a timer for forms to turn off and on and I was going to use a timer control and I noticed there is a timer class. What is the difference? Should I use the timer class instead?
View 5 RepliesI've been working in .NET for some time now, but occasionally I still get confused by a disparity between the framework and my prior experience in C++.In .NET, all objects are either value types or reference types. Reference types are allocated on the heap while value types are allocated on the stack (in the current CLR implementation, anyway). I get that. However, at least in VB.NET, you can still define a constructor on a value type.
Public Structure Coordinates
Public x As Integer
Public y As Integer
[code]....
When we can access the public methods via object then why is there need of inheritance.
View 2 RepliesIn VB.Net is there any difference between the following three ways of initializing object variables
Method 1
Dim commandObject As SqlCommand
commandObject = New SqlCommand("MadeUpCommand")
Method 2
Dim commandObject As SqlCommand = New SqlCommand("MadeUpCommand")
Method 3
Dim commandObject As New SqlCommand("MadeUpCommand")
Is one more efficient than the others, or are they effectively all the same?
if you are debugging or releasing a projet , vs writes exe or bin files to the bin and obj folder in a release and debug version, are ther differences bewteen these files with the same name in 4 folders ?, eg myproject.exe
View 3 RepliesI`m a beginning programmer, and I`m trying to build my first 100% object. The object would be a USER object, representing rekords from users table in database. The table in the database has 5 columns ->
[Code]...
below are 2 lines of code i just wanted to be sure is the first type myInt a refrence type and the second variable myInt2 a value type?
[Code]...
Possible Duplicate: What's the purpose of the Tuple(T1)/Singleton in .net?
Trying to mimic a Tuple as implemented in .Net 4 (For .Net 3) I just realized there is a Tuple(Of T)? This was quite a surprize!
Tuple<string> result = new Tuple<string>("Data");
Instead of this
return "Data";
Isn't the whole point of a tuple that its a container for "loosely related data that isnt cohesive enough to make another class"?
I have a question, i have worked in several languages in my life (including several versions of basic) but i wonder whether in .NET using a variable or equation in a loop is a lot slower than not using one? Take the following identical loops
Dim test(999) As Integer
For count As Integer = 0 to 999
test(count) = count
Next
[Code]...
Now the 2nd case is good because it is easier to adjust the code should the array size need to change yet my background tells me the 1st case is the one in terms of performance, test.Length - 1 is calculated each time the loop runs. a loop of the 2nd kind for example has a massive effect on java as well as VBscript or javascript.So heres the question, would test.Length - 1 be calculated each time the loop ran, or just the first time?
Private Sub Recipient_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Recipient.KeyPress
If Char.IsLetter(e.KeyChar) Then[code].....
whats the requirement of hardware for sql server
View 1 RepliesNo errors are given in either first or second code besides theinputbox whats wrong here ?
1:)
Dim readings(-1) As integer
2:)
[code].....
I'm doing a project involving VB.Net 2008 and SQL.
I'm trying to make a combobox display whats in the sql database that is connected on the left hand side.
Im trying finish my Chat room and I just need to know how to make it send when they push enter so they dont have to click the button.How would I make it send Whats in textbox1 when they push enter?
View 6 RepliesI have a RichText area, and wanted to create a button, that will take whats in the RichText area, and come up with the prompt for the user to save somewhere on the machine..
View 1 Replieswhat's the difference between variable array and object array?
View 7 Replieswhats the page life cycle in Ajax call in Asp.net?
View 2 RepliesI was looking on the interweb to see if there were any good examples on how to initialize shared members within a class while still initializing instance variables. I did find an expression that might fit to the answer:
[code]...
How do I initialize both instance and shared members without re-initializing the shared members every time an object is created from a class? Thanks!
i'm trying to check whats the highest rev number in a folder (file names are 123456_rev01.*, 123456_rev02.*).
here is my code
For j = 1 To File.Exists("c: est123456" & "*" & j & ".*") = False
MsgBox("looking at rev" & j)
j = j + 1
[Code].....