<%@ Page AspCompat ="true" %>
<%@ ASPCOMPAT="true" %> directive, is for STA Single threaded apartment pool.
Late Binding
as always, asp might contain adodb library and connection to database. C# is strongly typed language , we can not simply use ADODB in it.
so we need reflection namespace for binding.
<%@ Import Namespace="System.Reflection" %>
conn=Server.create("ADODB.Connction");
its methods(Open) and recordset's execute will be invoked thought late binding.
conn.GetType().InvokeMember("Open",BindiingFlags.InvokeMethod,...)(see MSDN for full parameters details).
It is always a better idea to use early binding for performance reason therfore one can use TLBimp.exe tool to convert old Com components into .Net assemblies.
No comments:
Post a Comment