Skip to main content

Posts

Iterator in csharp

Iterator What is iterator? Iterator is a method or function implementation which implements the iterative features for objects and its return type must be IEnumerable type. We can implement iterators in C# read-only property also (only with get ) In each iteration this method or properties returns one element with the help of Yield return statement What is yield Yield is a keyword which is introduced in Csharp and VB.Net to implement iterator .yield is working like return statement in functions but it will call more than one time like loop. yield gives enumeration properties implicitly for object(i.e means explicitly no need to implement IEnumerator) . Yield was implemented in C-sharp and vb.net with different keyword Yield return <expression>; in C# We used yield return statement in iterator to return each element Example static void Main( string [] args)          {             foreach ( var item in getno())         

Start menu in windows 8

Start menu in windows 8   Now a days we are using windows 8 it is good and   great but when you migrate from windows XP and windows 7 you miss the windows start button In windows 8 and windows 8.1 everything we have to do with apps menu is   easy but as windows XP user it is very difficult to overcome this we can depend on 3 rd (which is not developed by Microsoft) party tool that is available here Check and enjoy with simple steps It is free and no extra activities are required enjoy  

OOPS-Constructors and distractor

Hi friends today we will discussed about constructors and distractor in csharp Constructors are used to memory allocation for real world entities which are created with the help of objects. When program or application is running, application required memory to save and manipulate data of that real world object/entities. Now the question is how much memory is required for that object? Frankly no one can decide how much memory is required for that application because of that all object oriented programming languages depends on heap memory. Heap memory is a logical memory in RAM (temporary memory) and size is logically infinity (physically it is limited).This memory has to be creating at run time when we are using object in our program/application. Now we have to know that what type of data members we have in object. In object we have two types of data members’ object instance  shared instance Object instance are allocated occupies object memory and eve

SQLSERVER Functions- Coalesce()

SQL  Server  built-in functions Coalesce() It is A function Is Very Much Useful at Run time When We Have Multi Value Attribute in a Table. If U Consider below facts placed in a employee table With Id, Name, ph_no, Alt_no, Office no. id Name Ph_ no Alt_ no Office no 101 Albert 999999 456453 321333 102 khan null null 123455 103 victor 112121 null null 104 lovely null null 1897321 Above Employee table may have single value are three values if it have single value then it fill null  values with remaining attributes When We Retrieve The Number from employee table That Number Should Not be Null value To get not null value from employee table We Use Coalesce() Function It Returns First Encountered Not Null Value  from employee table select id , name , coalesce ( Ph_no , Alt_no , Office_no ) as contact number from employee

Csharp Events basics

Events in C# Syntax of event declaration [attributes][modifers] event <delegate_type> <event_name>[ {event body}   ]; we will discuses about syntax of event ·         Attribute s are csharp attributes ·         Modifiers are optional and those may one are combination of more than one o    Accessing specifies §   Public, private, protected, internal §   New, Virtual, Abstract, override §   Static ,extern o    Event will work between objects because of that when your are defining event in main function existing class you have to specifies event as static              ·         Event o    It is a keyword used to give event declaration o    In syntax event keyword must not be omitted ·         Type o    Event is a role player  variable foe delegate o    Without delegate event will not fired o    Type is a delegate type which is giving functions to event at run time when event is fired this process is known as hookup ·  

visual studio comments

How many ways you can write comments in Visual Studio? We can do comments for internal documentation purpose. Dot net allows 3 types of comments. In previous languages(c,cpp) we learned how to write single and more then one line comments // this is example of one line comments /* this is Multi line comment  */  XML Documentation comments can write in Visual Studio using three slash {///aaaa}.This commented data or information is used by developer with the help of tool Tip at code development time. above code we explained single,multi line comments and XML Documentation.. thank you

LINQPAD

do you want learn LINQ with IDE ? yes you can work with saparate IDE for linq it support for LINQPad supports everything in C# 4.0/5.0 and Framework 4: LINQ to Objects ,SQL, Entity Framework,XML,Parallel LINQ,OData / WCF Data Services - including StackOverflow, SharePoint, and Windows DataMarket Microsoft Reactive Framework download linqpad tools for fw 3.5 and 4.0 goodbye to SQL Management Studio!

connection pooling

Explain about Connection Pooling? Connection pooling is a concept which deals with database connection. A Connection Pool maintain last database connection active state when connection is ideal. Whenever you want to make a transaction with database once again you have to open connection when it is ideal, instead of that connection pooling will maintain open and reusable connections. A Connection Pool is released from the buffer or memory when the last connection to the database is closed. By default Connection Pooling turned on in ado.net; whenever you want to change it off, you have to specify Pooling = false in the connection string . We can specify limit to connection pooling by default the maximum limit is 100. You will specify in connection string. It will improves the performance and scalability of the application It is managed by a program in ado.net that we called as Pool Manager. This program will ma