Search This Blog
Monday, 30 May 2011
OOPS Concepts in C# Sessions For Free
I am planning to take OOPS session in C# in weekends for free. Anybody who wants to learn OOPS is welcome..If interested leave a comment with your email id..Please forward to all your friends who might be interested..
Sunday, 29 May 2011
My Articles on DotNetSpider
I have been an active member of this site for a long time and in the course I wrote many articles based on common problems faced by developers. Below is a compiled list for your reference
How to Read Excel into Access Database Using ADO.Net and C#
In this article you can learn:-
1. Creating Access database from C# code
2. Reading Excel file into database
3. Drop table in Access database using code
4. Create table in Access database using code
5. Copy values from dataset to access table
You can access this article here
Implementing Session in WebService
This question is asked many times in interview..This is possible with System.Net.CookieContainer class
This article can be accessed here
Polymorphism
As per BOOCH " Poly means Many and Morphs means Forms" So Polymorphism is One thing and many forms. Polymorphism is of two types:-
a.) Compile Time Polymorphism
Compiler resolves the method calls at compile time. It can be achieved using Function overloading and Operator Overloading.
For Function Overloading refer
For Operator Overloading refer
b.) Runtime Polymorphism
Compiler resolves method calls at runtime. It can be achieved using Method Overriding and Casting.
To understand runtime polymorphism you need to have solid OOPS concepts. Below are my articles on OOPS. This is a four part series that will certainly shake your OOPS fundamentals
Part 1
Part 2
Part 3
Part 4
Multiple Active Result Set
MARS is a new feature in ado.net 2.0 and Sql Server 2005 that allows for multiple forward only read only result sets. With this feature in ADO.NET 2.0 you can have multiple active commands on one connection. By using MARS, you can open a connection to the database, open a new command and process some results, open a second command and process those results, then go back to the first command and process more results.
You can access complete article here
Events and Delegate Sample to Pass information from User Control to Main Page
This article talks about how to create custom events in user control to allow interaction with parent page.
This article can be accessed here
How to Read Excel into Access Database Using ADO.Net and C#
In this article you can learn:-
1. Creating Access database from C# code
2. Reading Excel file into database
3. Drop table in Access database using code
4. Create table in Access database using code
5. Copy values from dataset to access table
You can access this article here
Implementing Session in WebService
This question is asked many times in interview..This is possible with System.Net.CookieContainer class
This article can be accessed here
Polymorphism
As per BOOCH " Poly means Many and Morphs means Forms" So Polymorphism is One thing and many forms. Polymorphism is of two types:-
a.) Compile Time Polymorphism
Compiler resolves the method calls at compile time. It can be achieved using Function overloading and Operator Overloading.
For Function Overloading refer
For Operator Overloading refer
b.) Runtime Polymorphism
Compiler resolves method calls at runtime. It can be achieved using Method Overriding and Casting.
To understand runtime polymorphism you need to have solid OOPS concepts. Below are my articles on OOPS. This is a four part series that will certainly shake your OOPS fundamentals
Part 1
Part 2
Part 3
Part 4
Multiple Active Result Set
MARS is a new feature in ado.net 2.0 and Sql Server 2005 that allows for multiple forward only read only result sets. With this feature in ADO.NET 2.0 you can have multiple active commands on one connection. By using MARS, you can open a connection to the database, open a new command and process some results, open a second command and process those results, then go back to the first command and process more results.
You can access complete article here
Events and Delegate Sample to Pass information from User Control to Main Page
This article talks about how to create custom events in user control to allow interaction with parent page.
This article can be accessed here
Dynamic Compilation of ASP.Net page using BuildManager Class
Few days back I came across a problem on asp.net site where a user wanted to get information about controls of a Page from a different page. Problem with this approach is that server loads the requested page in memory. So at one time you can be only in one page say Page1. We can create object of Page2 from Page1 but can't get information about controls since controls gets initialized only when Page_Init fires and since we are just creating object of Page there is no life cycle involved with this.
Now just to get you started .Net provides lot of classes that help in dynamic compilation of pages and can be very useful if you want to cache your pages for faster access and better user experience. You should know that asp.net pages are compiled when requested by user and cached for later use.
The class that we are going to discuss and use is BuildManager class.Lets count number of panel controls in Page2 from Page1.
I wrote an article on asp.net wiki site long time back explaining the approach...
Please refer original article for complete sample and understanding..
http://wiki.asp.net/page.aspx/894/get-information-of-programatically-created-aspnet-page-using-buildmanager-class/
Now just to get you started .Net provides lot of classes that help in dynamic compilation of pages and can be very useful if you want to cache your pages for faster access and better user experience. You should know that asp.net pages are compiled when requested by user and cached for later use.
The class that we are going to discuss and use is BuildManager class.Lets count number of panel controls in Page2 from Page1.
I wrote an article on asp.net wiki site long time back explaining the approach...
Please refer original article for complete sample and understanding..
http://wiki.asp.net/page.aspx/894/get-information-of-programatically-created-aspnet-page-using-buildmanager-class/
Tuesday, 24 May 2011
Live Smooth Streaming using IIS
Just recently somebody asked me how to make a clone of YouTube.. At that time I didn't have much idea about that but i knew that the architecture can be to create a service in WCF service that supports live streaming using MTOM and have a Silverlight or Asp.Net client which will show the streams to the user on demand. But showing live streaming is much more just playing videos on the web.. It's about DRM as well since you just can't play any video which you are not authorized to play and you could be booked for copyright infringement if you do so..
Another important is right codecs to display the stream correctly so as you can already see it's a lot of work and not just any work..
While answering a question on asp.net site i came across a similar question and when i dig deep into it I came up with something unknown for as well as so powerful that it can really rock you to the hilt...
Here is the link exploring the untapped powers of IIS as well as some of the newer kids on the block ( Silverlight, Expression web)...
http://learn.iis.net/page.aspx/620/getting-started-with-iis-live-smooth-streaming/
What more you can support LIVE streaming ...
Dig deep and let me know how you would like this blog post...
And Last but not least..Any issues just drop me an email or leave a comment... Obliged to help..
Another important is right codecs to display the stream correctly so as you can already see it's a lot of work and not just any work..
While answering a question on asp.net site i came across a similar question and when i dig deep into it I came up with something unknown for as well as so powerful that it can really rock you to the hilt...
Here is the link exploring the untapped powers of IIS as well as some of the newer kids on the block ( Silverlight, Expression web)...
http://learn.iis.net/page.aspx/620/getting-started-with-iis-live-smooth-streaming/
What more you can support LIVE streaming ...
Dig deep and let me know how you would like this blog post...
And Last but not least..Any issues just drop me an email or leave a comment... Obliged to help..
Migrating to Asp.Net 4.0???
Have you been working on asp.net 2.0 or 3.5 and now thinking about migrating to Asp.Net 4.0? If yes then let me tell me that there are breaking changes from asp.net 3.5 to asp.net 4.0.. I call them breaking changes since the changes are lot and were very much needed.. To know more about what's new
http://www.asp.net/learn/whitepapers/aspnet4
And yes there are breaking changes as well i.e. changes that will actually break your existing website and for which you actually need to change youe existing implentation.
For a complete list refer
http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes
http://www.asp.net/learn/whitepapers/aspnet4
And yes there are breaking changes as well i.e. changes that will actually break your existing website and for which you actually need to change youe existing implentation.
For a complete list refer
http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes
Best Practices for Speeding Up Your Web Site
While working in one of the companies as a technical architect. I did a lot of performance optimizations for the site. Some of the tools that we used were YSlow which is an extension tool provided by yahoo as well as Firebug which is an extension of Firefox. Firebug allow you to check for number of requests page is making as well help in formatting , hacking stuff...
Below is a very good article by Yahoo developers that analyzes performance implications for a web page and how you can improve them.
I followed it that time and I do follow it regularly..It's an addiction to make your web site run faster..Isn't it
http://developer.yahoo.com/performance/rules.html
So implement it for your web sites as well and do let me know in case you face any issue while implemeting the rules...
Last but not least dont forgot to install YSlow to test your page's performance..
Happy Coding...
Waiting for feedbacks on the same...
Below is a very good article by Yahoo developers that analyzes performance implications for a web page and how you can improve them.
I followed it that time and I do follow it regularly..It's an addiction to make your web site run faster..Isn't it
http://developer.yahoo.com/performance/rules.html
So implement it for your web sites as well and do let me know in case you face any issue while implemeting the rules...
Last but not least dont forgot to install YSlow to test your page's performance..
Happy Coding...
Waiting for feedbacks on the same...
Sunday, 1 May 2011
How to know if your machine is connected to internet
using System ;
using System.Runtime ;
using System.Runtime.InteropServices ;
public class InternetConnectionChecker
{
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( int out description, int reservedValue ) ;
public static bool IsMachineConnectedToInternet( )
{
int desc ;
return InternetGetConnectedState( out desc, 0 ) ;
}
}
using System.Runtime ;
using System.Runtime.InteropServices ;
public class InternetConnectionChecker
{
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( int out description, int reservedValue ) ;
public static bool IsMachineConnectedToInternet( )
{
int desc ;
return InternetGetConnectedState( out desc, 0 ) ;
}
}
Subscribe to:
Comments (Atom)