Wednesday, November 17, 2010

Run and Log-in to Multiple Windows Live (MSN) Messenger with MultiMSN

windows Live Messenger (previously known as MSN Messenger) only allow user to load or launch one session or instance of WLM messenger service. One WLM only bring some trouble to instant messeging addicts who have more than one Windows Live ID (Hotmail or MSN user ID). That’s mean only 1 login user ID can be online at any one time at one computer. Multi MSN is a small program that enable multiple account login ID and multiple instance (more than once) of MSN or Windows Live Messenger to load in 1 computer at the same time. Multi MSN also has added feature for removing the bottom ads banner on the messenger contact list and chat windows.

The different version of MultiMSN patcher is available for each different specific version of MSN Messenger or Windows Live Messenger. The application of Multi MSN is pretty simple, just download MultiMSN that corresponding to your version of MSN Messenger or Windows Live Messenger, unzip the executable binary, and run the MultiMSN program. MultiMSN window will appear and allow users to select and choose which patch type that they want Multi MSN to fix into MSN Messenger or Windows Live Messenger. The options available are MultiMSN or SingleMSN, Hide Banner or Show Banner of Contact List Banner and Chat Window Banner.
As mentioned, since MultiMSN can only apply to the very specific version of instant messaging client that it supported, MultiMSN will check for version compatibility. If the messanger client is wrong version, “Version incompatible” will be shown on the window title bar. Some annoying though, the latest version of MultiMSN version 8.0.0812 has a pop-up message asking for donation.

Download MultiMSN

MultiMSN 8.0.0812
MultiMSN 8.0.0792
MultiMSN 8.0.0787
MultiMSN 8.0.0683
MultiMSN 7.5.0322
MultiMSN 7.5.0311

Thursday, November 4, 2010

Difference between inner join and outer join

An inner join will return a row only if there is a joined row with data in both tables- being joined. An outer join will return a row even if the other table doesn't have a corresponding row.

With an example I will make the scenarios clear. I will create two tables named student and dept. In the student table there will be one department but the corresponding department is not exist in dept table. Now I perform both inner join and outer join on deptid column.

SQL> create table student(stdid number, name varchar2(15),deptid number);
Table created.

SQL> insert into student values (024413,'Rafi',3);
SQL> insert into student values (024101,'Raju',1);
SQL> insert into student values (024434,'Arju',3);


SQL> create table dept(deptid number,deptname varchar2(10));
Table created.

SQL> insert into dept values(2,'EEE');
SQL> insert into dept values(3,'CSE');

SQL>  select s.name,d.deptname from dept d INNER JOIN student s 
on d.deptid=s.deptid;
NAME            DEPTNAME
--------------- ----------
Rafi            CSE
Arju            CSE

See in case of INNER join rows return only if joined row exist with data in both tables.
SQL> select s.name,d.deptname from dept d RIGHT OUTER 
JOIN student s on d.deptid=s.deptid;
NAME            DEPTNAME
--------------- ----------
Arju            CSE
Rafi            CSE
Raju

SQL> select s.name,d.deptname from dept d LEFT OUTER JOIN student s 
on d.deptid=s.deptid;
NAME            DEPTNAME
--------------- ----------
Rafi            CSE
Arju            CSE
                EEE

SQL> select s.name,d.deptname from dept d FULL OUTER JOIN student s 
on d.deptid=s.deptid;
NAME            DEPTNAME
--------------- ----------
Rafi            CSE
Arju            CSE
                EEE
Raju

As we see in case of OUTER join it return a row even if the other table doesn't have a corresponding row.
Source http://arjudba.blogspot.com/2008/06/difference-between-inner-join-and-outer.html

Monday, November 1, 2010

What's New in Visual Basic 2010

Visual Studio 2010
This page lists the new and enhanced features available in Visual Basic 2010. Click the links in the following sections to read more about a feature.
Visual Basic Compiler and Language

Auto-Implemented Properties

Auto-implemented properties provide a shortened syntax that enables you to quickly specify a property of a class without having to write code to Get and Set the property. For more information, see Auto-Implemented Properties (Visual Basic).

Collection Initializers

Collection initializers provide a shortened syntax that enables you to create a collection and populate it with an initial set of values. Collection initializers are useful when you are creating a collection from a set of known values, for example, a list of menu options or categories. For more information, see Collection Initializers Overview (Visual Basic).

Implicit Line Continuation

In many cases, implicit line continuation enables you to continue a statement on the next consecutive line without using the underscore character (_). For a list of all the cases in which you can omit an underscore character, see Statements in Visual Basic.

Multiline Lambda Expressions and Subroutines

Lambda expression support has been expanded to support subroutines in addition to multiline lambda functions and subroutines. For more information, see Lambda Expressions (Visual Basic).

New Command-Line Option for Specifying a Language Version

The /langversion command-line option causes the compiler to accept only syntax that is valid in the specified version of Visual Basic.

Type Equivalence Support

You can now deploy an application that has embedded type information instead of type information that is imported from a Primary Interop Assembly (PIA). With embedded type information, your application can use types in a runtime without requiring a reference to the runtime assembly. If various versions of the runtime assembly are published, the application that contains the embedded type information can work with the various versions without having to be recompiled. For more information, see /link (Visual Basic). For examples, see Walkthrough: Embedding Type Information from Microsoft Office Assemblies (C# and Visual Basic) and Walkthrough: Embedding Types from Managed Assemblies (C# and Visual Basic).

Dynamic Support

Visual Basic binds to objects from dynamic languages such as IronPython and IronRuby. For more information, see Working with Dynamic Objects (Visual Basic) and Walkthrough: Creating and Using Dynamic Objects (C# and Visual Basic).

Covariance and Contravariance

Covariance enables you to use a more derived type than that specified by the generic parameter, whereas contravariance enables you to use a less derived type. This allows for implicit conversion of classes that implement variant interfaces and provides more flexibility for matching method signatures with variant delegate types. You can create variant interfaces and delegates by using the new In and Out language keywords. The .NET Framework also introduces variance support for several existing generic interfaces and delegates, including the IEnumerable<T> interface and the Func<TResult> and Action<T> delegates. For more information, see Covariance and Contravariance (C# and Visual Basic).
Integrated Development Environment

The following sections describe enhancements to the Visual Studio integrated development environment (IDE).

Navigate To

You can use the Navigate To feature to search for a symbol or file in source code. You can search for keywords that are contained in a symbol by using Camel casing and underscore characters to divide the symbol into keywords.
For more information, see How to: Search for Objects, Definitions, and References (Symbols).

Highlighting References

When you click a symbol in source code, all instances of that symbol are highlighted in the document.
For many control structures, when you click a keyword, all of the keywords in the structure are highlighted. For instance, when you click If in an If...Then...Else construction, all instances of If, Then, ElseIf, Else, and End If in the construction are highlighted.
To move to the next or previous highlighted symbol, you can use CTRL+SHIFT+DOWN ARROW or CTRL+SHIFT+UP ARROW. For more information, see How to: Use Reference Highlighting.

Generate From Usage

The Generate From Usage feature enables you to use classes and members before you define them. You can generate a stub for any class, constructor, method, property, field, or enum that you want to use but have not yet defined. You can generate new types and members without leaving your current location in code. This minimizes interruption to your workflow.
Generate From Usage supports programming styles such as test-first development. For more information, see Generate From Usage.

IntelliSense Suggestion Mode

IntelliSense now provides two alternatives for IntelliSense statement completion: completion mode and suggestion mode. Suggestion mode is used when classes and members are used before they are defined. For more information, see List Members.
Sample Applications

Visual Basic includes new sample applications that demonstrate the following features: auto-implemented properties, implicit line continuation, collection initializers, covariance and contravariance, and multiline lambda expressions and subroutines. For information about Visual Basic language samples and how to access them, see Visual Basic Language Samples.

Monday, October 25, 2010

VB.NET and C# Comparison

This is a quick reference guide to highlight some key syntactical differences between VB.NET and C#. Hope you find this useful!Thank you to Tom Shelton, Fergus Cooney, Steven Swafford, Gjuro Kladaric, and others for your contributions.
Also see Java and C# Comparison.


Go to VB.NET and C# Comparison
http://www.harding.edu/fmccown/vbnet_csharp_comparison.html

Convert Csharp to Vb

http://www.developerfusion.com/tools/convert/csharp-to-vb/

Tuesday, October 5, 2010

MAX POOL SIZE WITH SQL SERVER

Connection Pooling Basics
Opening a database connection is a resource intensive and time consuming operation. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all connections currently in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.
Connection pooling behavior is controlled by the connection string parameters. The following are four parameters that control most of the connection pooling behavior:
  • Connect Timeout - controls the wait period in seconds when a new connection is requested, if this timeout expires, an exception will be thrown. Default is 15 seconds.
  • Max Pool Size - specifies the maximum size of your connection pool. Default is 100. Most Web sites do not use more than 40 connections under the heaviest load but it depends on how long your database operations take to complete.
  • Min Pool Size - initial number of connections that will be added to the pool upon its creation. Default is zero; however, you may chose to set this to a small number such as 5 if your application needs consistent response times even after it was idle for hours. In this case the first user requests won't have to wait for those database connections to establish.
  • Pooling - controls if your connection pooling on or off. Default as you may've guessed is true. Read on to see when you may use Pooling=false setting.
Common Problems and Resolutions
Connection pooling problems are almost always caused by a "connection leak" - a condition where your application does not close its database connections correctly and consistently. When you "leak" connections, they remain open until the garbage collector (GC) closes them for you by calling their Dispose method. Unlike old ADO, ADO.NET requires you to manually close your database connections as soon as you're done with them. If you think of relying on connection objects to go out of scope, think again. It may take hours until GC collects them. In the mean time your app may be dead in the water, greeting your users or support personnel with something like this:
Exception: System.InvalidOperationException Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Source: System.Data at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() ...
Exception: System.InvalidOperationException
Message: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
Source: System.Data
at  System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnection.Open()
Closing your connections
When you intend to close your database connection, you want to make sure that you are really closing it. The following code looks fine yet causes a connection leak:
     SqlConnection conn = new SqlConnection(myConnectionString);
      conn.Open();
      doSomething();
      conn.Close();                
If doSomething() throws an exception - conn will never get explicitly closed. Here is how this can be corrected:
     SqlConnection conn = new SqlConnection(myConnectionString);
      try
      {
            conn.Open();
            doSomething(conn);
      }
      finally
{
            conn.Close();                
      }
or
     using (SqlConnection conn = new SqlConnection(myConnectionString))
      {
            conn.Open();
            doSomething(conn);
      }
Did you notice that in the first example we called conn.Close() explicitly while in the second one we make the compiler generate an (implicit) call to conn.Dispose() immediately following the using block? The C# using block guarantees that the Dispose method is called on the subject of the using clause immediately after the block ends. Close and Dispose methods of Connection object are equivalent. Neither one gives you any specific advantages over the other.
When returning a connection from a class method - make sure you cache it locally and call its Close method. The following code will leak a connection:
OleDbCommand cmd new OleDbCommand(myUpdateQuery, getConnection());
      intres = cmd.ExecuteNonQuery();
     getConnection().Close(); // The connection returned from the first call to getConnection() is not being closed. Instead of closing your connection, this line creates a new one and tries to close it.
If you use SqlDataReader, OleDbDataReader, etc., close them. Even though closing the connection itself seems to do the trick, put in the extra effort to close your data reader objects explicitly when you use them.
Last but not the least, never Close or Dispose your connection or any other managed object in the class destructor or your Finalize method. This not only has no value in closing your connections but also interferes with the garbage collector and may cause errors. For more information see http://msdn.microsoft.com/library/en-us/cpguide/html/cpconprogrammingessentialsforgarbagecollection.asp.
Testing your changes
The only way to know the effect of your changes on connection pooling behavior is to load-test your application. If you have existing unit tests - use them. Running your unit tests repeatedly in a loop may create a fair bit of stress on application. If you don't, use the Web load testing tool. There are plenty of commercial load testing tools on the market. If you prefer freeware, consider OpenSTA available at www.opensta.org. All you need to setup your load test is to install the tool, bring up your Web application and click your way through. OpenSTA will record your HTTP requests into test scenarios that you can run as part of your load test.
Knowing that your application crashes under the load doesn't often help to locate the problem. If the app crashes fairly quickly, all you may need to do is run several load tests - one for each module and see which one has a problem. However, if it takes hours to crash you will have to take a closer look.
Monitoring connection pooling behavior
Most of the time you just need to know if your application manages to stay within the size of its connection pool. If the load doesn't change, but the number of connections constantly creep even after the initial "warm-up" period, you are most likely dealing with a connection leak. The easiest way to monitor the number of database connections is by using the Performance Monitor available under Administrative tools on most Windows installations. If you are running SQL Server, add SQL Server General Statistics -> User Connections performance counter (The counter is available on the SQL Server machine so you may need to put its name or IP address into the Select Counters From Computer box). The other way to monitor the number of database connections is by querying your DBMS. For example, on SQL Server run:
EXEC SP_WHO
Or on Oracle, run:
SELECT * FROM V$SESSION WHERE PROGRAM IS NOT NULL
.NET CLR Data performance counters
In documentation you may run into .Net CLR Data performance counters. They are great if you know what they can and cannot do. Keep in mind that they do not always reset properly. The following KB article sheds some light on the problem but in my opinion does not cover all the issues: http://support.microsoft.com/default.aspx?scid=kb;en-us;314429. Another thing to keep in mind is that IIS unloads app domains under stress so don't be surprised when your number of database connections has dropped to zero while your min pool size is five!
Short term fixes
What if you discovered the connection pooling issue in production and you cannot take it offline to troubleshoot? Turn pooling off. Even though your app will take a performance hit, it shouldn't crash! Your memory footprint will also grow. What if it doesn't crash all that often, and you don't want to take a performance hit? Try this:
conn = new SqlConnection();
try
{
  conn.ConnectionString = "integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Min Pool Size=5;Max Pool Size=60;Connect Timeout=2;";     // Notice Connection Timeout set to only two seconds!
  conn.Open();
}
catch(Exception)
{
  if (conn.State != ConnectionState.Closed) conn.Close();
  conn.ConnectionString = "integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Pooling=false;Connect Timeout=45;";
  conn.Open();
If I fail to open a pooled connection within two seconds, I am trying to open a non-pooled connection. This introduces a two second delay when no pooled connections are available, but if your connection leak doesn't show most of the time, this is a good steam valve.
Conclusion
In this article you've learned that the most common cause of connection pooling issues is database connections that are left open or not closed properly. You've learned that when you type "conn.Close()", you almost always want to put that in the "Finally" block. You also learned not to interfere with the class destructor unless you use unmanaged resources. You've learned how to monitor your connection pool and diagnose a potential problem. You also learned how to keep a system with a connection leak in production if you really have to, until the problem is resolved. I hope this article has helped you resolve your connection pooling issue. However, there is more to connection pooling that is not covered in this article. Check out Bill Vaughn's "Swimming in the .NET connection pool" at http://www.winnetmag.com/Article/ArticleID/38356/38356.html

Sources from http://www.15seconds.com

Thursday, April 8, 2010

Check size file upload by asp.net

If MyUpload.PostedFile.ContentLength > 3500000 then
lblMessage.Text = "File size cannot exceed 3.5 mb limit"
End If

Sunday, March 28, 2010

Open multiple yahoo messengers and use different IDs

1. Click START
2. choose RUN
3. Type regedit
4. click OK or press enter
5. When the registry window appears, click the following on the registry tree (left side):

    First: HKEY_CURRENT_USER
    then: Software
    then: yahoo
    then: pager
    then: Test

6. Go to the right side of the screen (under Default) then press the right button on your mouse (right click)
7. Choose DWORD value (press enter)
8. Rename it as Plural (capital P) (press enter)
9. Double click on Pural then put 1 as a value data. (Press enter)
10. Close the registry window

DONE!