Friday, October 7, 2011

Cloud ... clearing the cloudy concept.

Was interacting on a message thread with a friend on a networking portal on Cloud Computing. Since it went deep want to share it over here...

The  question ...
"In virtualization single pc act as multiple And in cloud many act as single
Actually there are so many articles on web and I m confused which one is right, true?"


The Answer...

Virtualization is static ... Cloud is dynamic.
Eg.
I have a site. I need that site to support 10 million users and the best server I am getting from my provider can support 2 million ... so I have to buy 5 such servers from him. Now even if my site is being used by 1 million users I still end up paying up for 5 servers, where as in cloud you pay as you consume ... Now if my provider has a cloud setup of 20 servers (each supporting 2 million (same as above but wrapped by a cloud layer) ) the cloud will dynamically add on more server machine if the users exceed 2 million and remove it when the hit count gets low. So I'll end up paying for server only when I use it.

The next question ...

"I am clear 95% ...But the addition and removal of servers will happen automatically ?
mean am I need to inform my cloud provider first time about my peak value..
Or it will happen in this way that I took one instance and host my site And forgot about visitors The extra server will add automatically when hit count goes up and when hit count goes down the extra server is removed automatically ? As in the above example should I need to buy one instance or 5 instances ?"

The Answer...
Yes its automatic ... The service providers will boast of their cloud network ... its you who need to make a choice. Providers like Amazon EC2, Microsoft Windows Azure, Google Cloud SQL (just for database hosting) will advertise the strength of their cloud (how much data they can handle, what is the computation speed and other benchmarks), so you need to pick one that suit your need. They will not increase or decrease the strength of their cloud on your need (they will always look to add more to their cloud). Its you who has to decide that the services that they list will be sufficient for you?
You just nee to pick the right service provider which has the adequate network (of servers, balances etc ) to support your need, rest is automatically handled.
If you want something private (mean creating your own cloud) you need to have an OS that support it like CloudLinux(already released) or Windows Cloud(about to release in a month) and you can make it as fat as you want.
Hope this help for the rest 5%

 The next question ...
"Okay Bro 99% :) last question :)
lets take your first example I have a java application and my peak load value is 2 million also video chat of three people is there with fms,red5 or wowza. For that scenario which provider is best. Is amazon with ec2 have support like that or any other provider ?"

The Answer...
Here is the final 1% of text which I'll try to clear the remaining 99% of the doubts ...
Firstly what I get from your ''last question" is ...that you have understood cloud but you are not clear what Amazon EC2 is ...
I'll talk about that first ...
Amazon Cloud provides various types of instances
1. Standard
2. Micro
3. High Memory
4. High CPU
5. Cluster
Each of the above type have defined set (capacity, memory, computation etc). You need to pick the one that suits you (your need)
Amazon provides web services to access its features
1. EC2 (Elastic Cloud) - To manage instances
2. S3 (Storage Service) - To manage data
3. RDS (Relational Database Service) - To manage database
4. SQS (Simple Queue Service) - To manage Message Queues

You can choose from pre-configured AIMs Amazon Machine Images or create your own AIM. Its is this AIM that gets loaded when you create an new instance using your EC2 web-service.
Amazon's pre-configured AIMs have the cost of AIM depends the type of software it contains. If you want to have streaming you can choose and AIM which has wowza media pro (if you want to use FMS you need to bear the licensing cost (and that will be per instance) ).

Once everything is chosen (Instance type with AIM that is required to run your site), you are ready for launch.
Amazon charges you for Instance usage per hour.
So now lets go back to you problem : Suppose you chose High CPU with AIM having wowza and Amazon rate for the same are $0.50 per hour. Now you calculated that the instance you chose would comfortably support half a million users.
You launched your site with one instance up after after an hour the user count crossed half million mark , using EC2 service you start another instance, after two hours it started crossing the million again via your web-service you start another instance. After five hours the hit cam down to half a million again so using you web-service you'll turn off two instances.

Here is how you are charged.
Total hours 7
1st hour - $0.50
2nd hour - $0.50+$0.50
3rd hour - $0.50+$0.50+$0.50
4th hour - $0.50+$0.50+$0.50
5th hour - $0.50+$0.50+$0.50
6th hour - $0.50
7th hour - $0.50
You are charged in instance basis.You may activate 100 instances if you feel the need.

The above example is to make you understand. There are other charges involved too like data transfer charges, region based server charges etc.

Hope this helps... 


Clearing the Cloudy Cloud. -S 

Thursday, July 14, 2011

Immutation in JAVA Explained

Watched X-Men, mutants were far more stronger than a normal  human being. I recalled my biology class where we studied genetics and chromosomal mutations. Mutations were triggered to make species better. I left biology and am now into software. Here also we do the same thing "Mutate". We override objects of the existing classes in the SDK/API/Framework to make them better or fit to our need. But you cannot override each and every object of the SDK/API,  they are protected from getting or being mutated for a reason. Making decisions on creating immutable class needs thorough analysis. How do I create a class which cannot be mutated?

In JAVA String class is a good example, its immutable.

Below are the rules that must be followed in order to create an immutable object.

1. No "setter" methods — methods that modify class members or objects referred to by class variables.
2. Make all class variables final and private.
3. Do not allow subclasses to override methods. The simplest way to do this is to declare the class as final. A more sophisticated approach is to make the constructor private and construct instances in factory methods.
4. If the instance fields include references to mutable objects, don't allow those objects to be changed:
       * Do not provide methods that modify the mutable objects.
       * Do not share references to the mutable objects.
5. Never store references to external, mutable objects passed to the constructor; if necessary, create copies, and store references to the copies.
6. Similarly, create copies of your internal mutable objects when necessary to avoid returning the originals in your methods.


Immutable laws of the universe can teach more exalted lessons than the holy books.
-S

Thursday, May 5, 2011

Copyrights, Licenses Explained

It just started when I was listening to radio while driving. The RJ used the word GPL for 'Gaane Premium League' ... It reminded me of two versions for the abbreviation. The one that we used during our college time and other which changed the face of software development. This post tries to explain common licensing models and terms used worldwide.

Its hard to understand the legal-speak of license terms and this post tries to capture their essence and make it easy to understand.

This matrix below tries to express some EULA, GPL, CDDL and BSD licenses in terms of the rights in copyrights and patent rights. A ticks and crosses are self explanatory. The gray tilt "~" means that the license does not say anything - mostly it is an implied OK.



Comparing GPL, CDDL and BSD licenses with respect to some common needs of developers who copy, modify or distribute a piece of software:



Honor Open Source: Keep the copyright notices and redistribute source.


GPL is real GPL for proprietary EULA.
-S

Friday, March 11, 2011

To all my .net friends. Common Database Connection Strings

Microsoft SQL Server

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Standard Connection

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={SQL Server};" +

"Server=ServerName;" +

"DataBase=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Trusted Connection

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={SQL Server};" +

"Server=ServerName;" +

"DataBase=DataBaseName;" +

"Uid=;" +

"Pwd=;";

conn.Open();

// or

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={SQL Server};" +

"Server=ServerName;" +

"DataBase=DataBaseName;" +

"Trusted_Connection=Yes;";

conn.Open();

// OleDb -- Standard Connection

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=SQLOLEDB;" +

"Data Source=ServerName;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// OleDb -- Trusted Connection

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=SQLOLEDB;" +

"Data Source=ServerName;" +

"Initial Catalog=DataBaseName;" +

"Integrated Security=SSPI;";

conn.Open();

// OleDb -- via IP Address

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=SQLOLEDB;" +

"Network Library=DBMSSOCN;" +

"Data Source=xxx.xxx.xxx.xxx,1433;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// .NET DataProvider -- Standard Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlDbConnection();

conn.ConnectionString =

"Data Source=ServerName;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// .NET DataProvider -- Trusted Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=ServerName;" +

"Initial Catalog=DataBaseName;" +

"Integrated Security=SSPI;";

conn.Open();

// .NET DataProvider -- via IP Address

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Network Library=DBMSSOCN;" +

"Data Source=xxx.xxx.xxx.xxx,1433;" +

"Initial Catalog=DataBaseName;" +

"User Id=UserName;" +

"Password=Secret;";

conn.Open();

Microsoft Sql Express

// .NET Data Provider -- Default Relative Path

// Standard Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"User Id=UserName;" +

"Password=Secret;" +

"AttachDbFilename=|DataDirectory|DataBaseName.mdf;"

conn.Open();


// .NET Data Provider -- Default Relative Path

// Trusted Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"Integrated Security=true;" +

"AttachDbFilename=|DataDirectory|DataBaseName.mdf;"

conn.Open();

// .NET Data Provider -- Custom Relative Path

// Standard Connection

using System.Data.SqlClient;

AppDomain.CurrentDomain.SetData(

"DataDirectory", "C:\MyPath\");

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"User Id=UserName;" +

"Password=Secret;" +

"AttachDbFilename=|DataDirectory|DataBaseName.mdf;"

conn.Open();

// .NET Data Provider -- Custom Relative Path

// Trusted Connection

using System.Data.SqlClient;

AppDomain.CurrentDomain.SetData(

"DataDirectory", "C:\MyPath\");

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"Integrated Security=true;" +

"AttachDbFilename=|DataDirectory|DataBaseName.mdf;"

conn.Open();

// .NET Data Provider -- Absolute Path

// Standard Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"User Id=UserName;" +

"Password=Secret;" +

"AttachDbFilename=C:\MyPath\DataBaseName.mdf;"

conn.Open();

// .NET Data Provider -- Absolute Path

// Trusted Connection

using System.Data.SqlClient;

SqlConnection conn = new SqlConnection();

conn.ConnectionString =

"Data Source=.\SQLExpress;" +

"User Instance=true;" +

"Integrated Security=true;" +

"AttachDbFilename=C:\MyPath\DataBaseName.mdf;"

conn.Open();

Microsoft Access

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString = "Dsn=DsnName";

conn.Open();

// ODBC -- Standard Security

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Access Driver (*.mdb)};" +

"Dbq=c:\myPath\myDb.mdb;" +

"Uid=Admin;Pwd=;";

conn.Open();

// ODBC -- Workgroup (System Database)

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Access Driver (*.mdb)};" +

"Dbq=c:\myPath\myDb.mdb;" +

"SystemDb=c:\myPath\myDb.mdw;";

conn.Open();

// ODBC -- Exclusive Use

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Access Driver (*.mdb)};" +

"Dbq=c:\myPath\myDb.mdb;" +

"Exclusive=1;";

"Uid=Admin;Pwd=;";

conn.Open();

// OleDb with MS Jet -- Standard Security

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=c:\mypath\myDb.mdb;" +

"User id=admin;" +

"Password=";

conn.Open();

// OleDb with MS Jet -- Workgroup (System Database)

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=c:\mypath\myDb.mdb;" +

"System Database=c:\mypath\myDb.mdw;";

conn.Open();

// OleDb with MS Jet -- With Password

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=c:\mypath\myDb.mdb;" +

"Database Password=Secret;"

conn.Open();

Oracle

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- New Microsoft Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft ODBC for Oracle};" +

"Server=OracleServer.world;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Old Microsoft Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft ODBC Driver for Oracle};" +

"ConnectString=OracleServer.world;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Oracle Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Oracle ODBC Driver};" +

"Dbq=myDataBase;" + // define in tsnames.ora

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// OleDb -- Microsoft Driver

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=MSDAORA;" +

"Data Source=ServerName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// OleDb -- Oracle Driver -- Standard Connection

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=OraOLEDB.Oracle;" +

"Data Source=ServerName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// OleDb -- Oracle Driver -- Trusted Connection

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=OraOLEDB.Oracle;" +

"Data Source=ServerName;" +

"OSAuthent=1;";

conn.Open();

// or

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=OraOLEDB.Oracle;" +

"Data Source=ServerName;" +

"User id=/" +

"Password=;";

conn.Open();

// .NET DataProvider from Microsoft

// -- Standard Connection

using System.Data.OracleClient;

OracleConnection conn = new OracleConnection();

conn.ConnectionString =

"Data Source=ServerName;" +

"User id=UserName;";

"Password=Secret;";

conn.Open();

// .NET DataProvider from Microsoft

// -- Trusted Connection

using System.Data.OracleClient;

OracleConnection conn = new OracleConnection();

conn.ConnectionString =

"Data Source=Servername;" +

"Integrated Security=Yes;";

conn.Open();

// .NET DataProvider from Oracle

// -- Standard Connection

using Oracle.DataAccess.Client;

OracleConnection conn = new OracleConnection();

conn.ConnectionString =

"Data Source=ServerName;" +

"User id=UserName;";

"Password=Secret;";

conn.Open();

// .NET DataProvider from Oracle

// -- Trusted Connection

using Oracle.DataAccess.Client;

OracleConnection conn = new OracleConnection();

conn.ConnectionString =

"Data Source=Servername;" +

"Integrated Security=Yes;";

conn.Open();

IBM DB2

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC without DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={IBM DB2 ODBC DRIVER};" +

"DataBase=DataBaseName;" +

"HostName=ServerName;" +

"Protocol=TCPIP;" +

"Port=PortNumber;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// OleDb -- Microsoft Driver

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=DB2OLEDB;" +

"Network Transport Library=TCPIP;" +

"Network Address=xxx.xxx.xxx.xxx;" +

"Package Collection=CollectionName;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// OleDb -- IBM Driver

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=IBMDADB2;" +

"DataBase=DataBaseName;" +

"HostName=ServerName;" +

"Protocol=TCPIP;" +

"Port=PortNumber;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// .NET DataProvider from IBM

using IBM.Data.DB2;

Db2Connection conn = new Db2Connection();

conn.ConnectionString =

"DataBase=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;" +

conn.Open();

MySql

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- MyODBC Driver -- local database

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={MySql};" +

"Server=localhost;" +

"Option=16834;" +

"DataBase=DataBaseName;"

conn.Open();

// ODBC -- MyODBC Driver -- remote database

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={MySql};" +

"Server=db.domain.com;" +

"Option=131072;" +

"Port=3306;" +

"Stmt=;" +

"DataBase=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;"

conn.Open();

// ODBC -- MySQL ODBC 3.51 Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={MySql ODBC 3.51 Driver};" +

"Server=ServerName;" +

"Option=16834;" +

"Port=3306;" +

"Stmt=;" +

"DataBase=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;"

conn.Open();

// or

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"DRIVER={MySql ODBC 3.51 Driver};" +

"SERVER=ServerName;" +

"DATABASE=DataBaseName;" +

"USER=UrerName;" +

"PASSWORD=Secret;"

conn.Open();

// OleDb

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Provider=MySqlProv;" +

"Data Source=ServerName;" +

"User id=UserName;" +

"Password=Secret;"

conn.Open();

// .NET DataProvider from CoreLab

using CoreLab.MySql;

MySqlConnection conn = new MySqlConnection();

conn.ConnectionString =

"Host=ServerName;" +

"DataBase=DataBaseName;" +

"Protocol=TCP;" +

"Port=3306;" +

"Direct=true;" +

"Compress=false;" +

"Pooling=true;" +

"Min Pool Size=0;" +

"Max Pool Size=100;" +

"Connection Lifetime=0;" +

"User id=UserName;" +

"Password=Secret;" +

conn.Open();

Sybase

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Sybase System 12 (12.5) ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={SYBASE ASE ODBC Driver};" +

"Srvr=ServerName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Sybase System 11 ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={SYBASE SYSTEM 11};" +

"Srvr=ServerName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Intersolv 3.10 ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={INTERSOLV 3.10 32-BIT Sybase};" +

"Srvr=ServerName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- SQL Anywhere

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"ODBC;" +

"Driver={Sybase SQL Anywhere 5.0};" +

"DefaultDir=c:\myfolder\;" +

"Dbf=c:\mypath\dbname.db;" +

"Uid=UserName;" +

"Pwd=Secret;" +

"Dsn="""";"; // Must be included!

conn.Open();

// OleDb -- Sybase Adaptive Server Enterprise (ASE)

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=Sybase.ASEOLEDBProvider;" +

"Server Name=ServerName,5000;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

// optionally, replace

// 'Server Name' with 'Srvr', and

// 'Initial Catalog' with 'Catalog'

// .NET DataProvider from Sybase

using Sybase.Data.AseClient;

AseConnection conn = new AseConnection();

conn.ConnectionString =

"Data Source=ServerName;" +

"Initial Catalog=DataBaseName;" +

"User id=UserName;" +

"Password=Secret;";

conn.Open();

Interbase

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- EasySoft ODBC Driver -- local machine

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Easysoft IB6 ODBC};" +

"Server=localhost;" +

"DataBase=localhost:C:\MyPath\DbName.gdb;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- EasySoft ODBC Driver -- remote machine

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Easysoft IB6 ODBC};" +

"Server=ServerName;" +

"DataBase=ServerName:C:\MyPath\DbName.gdb;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Intersolv ODBC Driver -- local machine

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver=" +

"{INTERSOLV InterBase ODBC Driver (*.gdb)};" +

"Server=localhost;" +

"DataBase=localhost:C:\MyPath\DbName.gdb;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC -- Intersolv ODBC Driver -- remote machine

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver=" +

"{INTERSOLV InterBase ODBC Driver (*.gdb)};" +

"Server=ServerName;" +

"DataBase=ServerName:C:\MyPath\DbName.gdb;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

Informix

// ODBC DSN -- INFORMIX 3.30 ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Host=HostName;" +

"Server=ServerName;" +

"Service=ServerName;" +

"Protocol=olsoctcp;" +

"Database=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC without DSN -- INFORMIX 3.30 ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn="";" +

"Driver={INFORMIX 3.30 32 BIT};" +

"Host=HostName;" +

"Server=ServerName;" +

"Service=ServerName;" +

"Protocol=olsoctcp;" +

"Database=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC Informix-CLI 2.5 ODBC Driver

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Informix-CLI 2.5 (32 Bit)};" +

"Server=ServerName;" +

"DataBase=DataBaseName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// OleDb -- IBM Informix OleDb Provider

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=IFXOLEDBC;" +

"Data Source=DataBaseName@ServerName;" +

"User id=UserName;" +

"Password=Secret;";

"Persist Security Info=true;";

conn.Open();

Excel

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC without DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Excel Driver (*.xls)};" +

"Driverid=790;" +

"Dbq=C:\MyPath\SpreadSheet.xls;" +

"DefaultDir=C:\MyPath;";

conn.Open();

// OleDb with MS Jet

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=C:\MyPath\SpreadSheet.xls;" +

@"Extended Properties=""Excel 8.0;HDR=Yes""";

conn.Open();

Text

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Dsn=DsnName;" +

"Uid=UserName;" +

"Pwd=Secret;";

conn.Open();

// ODBC without DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Text Driver (*.txt; *.csv)};" +

"Dbq=C:\MyPath\;" +

"Extensions=asc,csv,tab,txt;";

conn.Open();

// Use: sql = "Select * From MyTextFile.txt"

// OleDb with MS Jet

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=C:\MyPath\;" +

"Extended Properties=" +

@"""text;HDR=Yes;FMT=Delimited""";

conn.Open();

// Use: sql = "Select * From MyTextFile.txt"

dBase Dbf

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString = "Dsn=DsnName";

conn.Open();

// Use: sql = "Select * From MyDb.dbf"

// ODBC without DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft dBASE Driver (*.dbf)};" +

"Driverid=277;" +

"Dbq=C:\MyPath\";

conn.Open();

// Use: sql = "Select * From MyDb.dbf"

Visual FoxPro

// ODBC DSN

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString = "Dsn=DsnName";

conn.Open();

// ODBC without DSN -- Database container (dbc)

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Visual FoxPro Driver};" +

"SourceType=DBC;" +

"SourceDB=C:\MyPath\MyDb.dbc;" +

"Exclusive=No";

conn.Open();

// ODBC without DSN -- Free table directory

using System.Data.Odbc;

OdbcConnection conn = new OdbcConnection();

conn.ConnectionString =

"Driver={Microsoft Visual FoxPro Driver};" +

"SourceType=DBF;" +

"SourceDB=C:\MyPath;" +

"Exclusive=No";

conn.Open();

// OleDb -- Database container (dbc)

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=VFPOLEDB;" +

"Data Source=C:\MyPath\MyDb.dbc;" +

"Collating Sequence=machine;" +

"Password=Secret;";

conn.Open();

// OleDb -- Free table directory

using System.Data.OleDb;

OleDbConnection conn = new OleDbConnection();

conn.ConnectionString =

"Driver=VFPOLEDB;" +

"Data Source=C:\MyPath\;" +

"Collating Sequence=general;" +

"Password=Secret;";

conn.Open();

BY THE TIME YOU REALIZE YOUR FATHER WAS RIGHT,YOU HAVE A SON WHO THINKS YOU ARE WRONG...THAT IS GENERATION GAP"
-S