Reflection and ADO. Net: Karthik Eetur
Reflection and ADO. Net: Karthik Eetur
Net
Karthik Eetur
REFLECTION
Reflection is a way of getting information about any
specific class or assembly at runtime. You can also say
its RTTI (Runtime Type Information).
With the help of reflection you can get the all the
properties and methods with arguments/parameters. You
can also get the list of classes, interfaces, structures and
enumeration in an assembly by using reflection.
You can dynamically create an instance of an object at
runtime and invoke methods dynamically.
examples of reflection: Object browser and Visual Studio
.NET IDE (Integrated Development Environment)
Namespace: System. Reflection
EdmItemCollection:
StorageMappingItemCollection :
Execute stored procedures that return result sets with or without output parameters
and return values.
Execute action queries that perform data manipulation or data definition operations.
Data Providers
.NET Framework data provider Description
.NET Framework Data Provider for For Microsoft® SQL Server™ version 7.0
SQL Server or later.
.NET Framework Data Provider for For data sources exposed using OLE
OLE DB DB.
.NET Framework Data Provider for For data sources exposed using ODBC.
ODBC Note The .NET Framework Data
Provider for ODBC is not included in
the .NET Framework version 1.0. If you
require the .NET Framework Data
Provider for ODBC and are using the
.NET Framework version 1.0, you can
download the .NET Framework Data
Provider for ODBC at
http://msdn.microsoft.com/downloads.
The namespace for the downloaded
.NET Framework Data Provider for
ODBC is Microsoft.Data.Odbc.
.NET Framework Data Provider for For Oracle data sources. The .NET
Oracle Framework Data Provider for Oracle
supports Oracle client software version
8.1.7 and later. Note The .NET
Framework Data Provider for Oracle is
not included in the .NET Framework
version 1.0. If you require the .NET
Framework Data Provider for Oracle
and are using the .NET Framework
version 1.0, you can download the .NET
Framework Data Provider for Oracle at
http://msdn.microsoft.com/downloads.
core elements of the .NET Framework
data provider model
Object Description
</configuration>
To store values in the configuration file,
you can create XML elements in the
format:
<add key="MyKey" value="MyValue" />
See the sample config entries below:
<?xml version="1.0" encoding= "utf-8" ?>
<configuration>
<appSettings>
<add key="DatabasePath"
value="c:\\projects\data\spider.mdb" />
</appSettings>
</configuration>
Read values from config file
To read from this config file, just use the
following code in your application:
string dbPath =
System.Configuration.ConfigurationSetti
ngs.AppSettings["DatabasePath"];
string email =
System.Configuration.ConfigurationSetti
ngs.AppSettings["SupportEmail"];
ConfigurationSettings is the class used to
access the contents of the configuration file
using System.Configuration;
If you have the above directive on top of
file, we can use
string dbPath =
ConfigurationSettings.AppSettings["Databa
sePath"];
string email =
ConfigurationSettings.AppSettings["Support
Email"];
In VB.NET, you have to use "( ... )"
instead of the "[ ... ]", as shown below:
Dim dbPath as String =
ConfigurationSettings.AppSettings("Dat
abasePath")
Dim email as String =
ConfigurationSettings.AppSettings("Sup
portEmail")
Thank you….