Part 1 - How to retrieve data from different databases in asp.net | Slides
Part 2 - Display database table metadata in asp.net web application | Slides
Part 3 - How to bind a computed column to GridView | Slides
Part 4 - Subtract largest even number and smallest odd number | Slides
Part 5 - Program to check if the user input is a string or an integer | Slides
Part 6 - Export data from sql server to csv file | Slides
const object obj = new object();
ReplyDeleteis it valid or not ? justify.
const object obj=new object(); //Invalid
ReplyDelete//Justification
const are compile time constant. Since new is for memory allocation and that will be done at runtime compiler won't allow it.
MSDN says the valid value for const type variables are constants i.e.1,"Venkat Sir",67.89(values which can be determined at compiled time) or null.Compiler will complain if you assign any other than this...
With this thumb rule in mind any assignment whose decision is done at runtime is not allowed for constant e.g. const int Hour=DateTime.Now.Hour is ERROR.
However change the statement to readonly object obj=new object();//Valid
because readonly are runtime constant.
I knew this because some geek asked me the difference between const and readonly and i was beginner(2 years back)......I feel good to realize that i took that question seriously and answered it today. Some small concepts always helps.
Go Ashish! :D
DeleteHi sir I'm very interested in becoming BI developer, but i have no experience with any development language. friend of mine sent me a link to your website and i like the way you explain things. My question is for beginner like me where would be the best place to start? Again thank you for your videos.
ReplyDeletehello sir
ReplyDeletehow can use bank gateway in asp.net if i have merchant account and access account and link it with my own website