var

VB.NET equivalent to C# var keyword

Is there a VB.NET equivalent to the C# var keyword? I would like to use it to retrieve the result of a LINQ query. ...

Passing a 'var' into another method

Hi, I am probably totally missing the point here but.... How can I pass a 'var' into another method? (I am using linq to load XML into an Enumerable list of objects). I have differernt object types (with different fields), but the final step of my process is the same regardless of which object is being used. XNamespace xmlns = Scehm...

var keyword without 'using someNamespace'

How does Visual Studio/intellisense know what to do with a variable declared as var even if you don't include the necessary using declaration at the top? For example, I have class MyDomainObject defined in a different namespace If I don't declare using TheOtherNameSpace; in the file the following code won't compile: private void Foo() ...

Can this Linq query be typed as anything other than "var"?

When I do a query that returns an anonymous type var assets = from Product p in Session.CreateLinq<Product>() where bundles.Contains(p.ProductBundle) select new {p.Asset, p.Asset.PropertyTbl}; Can I type the return to anything other than var? ...

What advantages does using var have over the explicit type in C#?

Possible Duplicates: Whats the point of the var keyword? Use of var keyword in C# I understand how IEnumerable<...> for a datatype can make the code a little less readable or how nested generics can seem a little daunting. But aside from code readability, are there advantages to using var instead of the explicit type? It see...

How to declare global var in javascript and HTML?

How to declare a variable, I think global, the way I declare in an html file and then use it in a js file (included by <script> tags)? ...

var (reference) in C# is boxing?

My boss forbide me to use var as it would cause boxing and slowing down the app. Is that true? ...

How to extract results from a Linq query?

class Program { static void Main(string[] args) { MyDatabaseEntities entities = new MyDatabaseEntities(); var result = from c in entities.Categories join p in entities.Products on c.ID equals p.IDCategory group p by c.Name into g select new ...

Passing the parameter

I am passing the parameter to the function as a var type. It is not accepting, how do I pass to the function? Example var Input = ................ listview1.itemsource = getinput(Input); public List<answers>getinput(var inp) { ................ .................. } Here the function is not accepting the var. What can I do? ...

No error or warning when attempt to access property of non object (not assigned)

Can somebody explain to me why PHP does not report a warning or error when accessing a property of a empty object (var is not assigned)? For example: $oMyObject->test = 'hello world'; // $oMyObject is not assigned but no warning or error When i do this, it produces an error: $oMyObject->test(); // Error: Calling function on non-obje...

Pros & Cons of var datatype in .net 3.5

Possible Duplicates: Use of var keyword in C# Use of var type in variable declaration Hello everybody, "Var keywork it require explicitly type casting Avoid boxing and unboxing value types where possible." Is it advisable to use var keyword instead of explicit datatype? ...

What is the difference between declaring javascript objects with var vs. with function?

I'm a confused newbie. I read in a tutorial that you create a javascript object like so: function myObject() { this.myProperty = "a string"; this.myMethod = function () { //Method code } } Then I read somewhere else that you create an object like so: var myObject = { myProperty: "a string", myMethod : fun...

what is the resulting value of this variable?

This is javascript var result = "2" + 5 + 5; what would the value of result be? im guessing the 2 isnt taken into consideration? would it be 210? Thanks ...