MATLAB: How to instantiate an ADO.NET object through .NET API in MATLAB 7.8 (R2009a)

MATLAB

I am trying to create an ADO.NET connection object to store data from MATLAB 7.8 (R2009a) into a database. Even though System.Data.dll is in Global Assembly Cache (GAC), using it results in an error.
a = System.Data.SqlClient.SqlConnection();
The error I receive is as follows:
??? Undefined variable "System" or class
"System.Data.SqlClient.SqlConnection".

Best Answer

Add the assembly as shown below before instatiating an object from it:
NET.addAssembly('System.Data');
a = System.Data.SqlClient.SqlConnection();
Please see the link below for more information on adding .NET assemblies:
<http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/brpcay8-1.html#brtk59p-1>