Buy Questpond's video subscriptions on
huge discount
.
Online: 3469
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
ASP.NET
>
Loading ...
how to use VAR keyword in ASP.net 2.0
Posted by
Alok
under
ASP.NET
on 4/5/2011 |
Points: 10
| Views : 4434 | Status :
[Member]
| Replies : 3
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
i have a application in .net3.5 which use VAR keyword .i want to use this application in 2.0 ,but it does not read var keyword
how can i use VAR keyword in .net 2.0.????
Thanks & Regards,
Alokssm
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Sashys
on: 4/19/2011
[Member]
Starter
|
Points: 25
0
The keyword VAR is introduces in C# 3.0 which we don't have in older versions of C#. It Declares Implicitly typed variable where the compiler identifies the type automatically. We need to use / declare the Explicit type variable based on our values. The object type will help us in this regard for some extent. Please paste the code snippet of your issue if possible. We can try for exact alternative for the problem.
Sasikumar .M
Alok
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Manishsoni
on: 4/20/2011
[Member]
Starter
|
Points: 25
0
Dear Alok,
var in anonymous type. It is introduced in framework 3.0
in This type variable you can assign any type of value like string, int, float even objects too.
Anonymous types are particularly useful when querying and transforming/projecting/shaping data with LINQ.
Example :--
var i=5;
var a="Abcd efg";
var b= 5.5555;
var b=new class();
you can use in LINQ also;
like
var abc= from (b in Table_123 where id=1 select b).List();
so if you want to degrade your application version. explicitly declare variable for such .
Thanks
Alok
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Manishsoni
on: 4/20/2011
[Member]
Starter
|
Points: 25
0
Dear Alok,
var in anonymous type. It is introduced in framework 3.0
in This type variable you can assign any type of value like string, int, float even objects too.
Anonymous types are particularly useful when querying and transforming/projecting/shaping data with LINQ.
Example :--
var i=5;
var a="Abcd efg";
var b= 5.5555;
var b=new class();
you can use in LINQ also;
like
var abc= from (b in Table_123 where id=1 select b).List();
so if you want to degrade your application version. explicitly declare variable for such .
Thanks
Alok
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...