不只是vb.net,C#等微軟的開發軟件可以調用.net framework,據我所知至少有28中我知道的開發語言如何調用.net framework.下面我就給出一段事例,說明使用perl.net來訪問數據庫 <%@ Page Language="Perl" %> <script runat="server">
use namespace "System::Data"; use namespace "System::Data::SqlClient";
=for interface protected override void OnLoad(System.EventArgs e); =cut
sub OnLoad { my($this, $e) = @_;
my $myConnection = SqlConnection->new("Data Source=(local); Trusted_Connection=Yes; Initial Catalog=pubs"); my $myCommand = SqlCommand->new("Select * From Publishers", $myConnection);
$myConnection->Open();
$this->{myDataGrid}{DataSource} = $myCommand->ExecuteReader(PerlNET::enum("CommandBehavior.CloseConnection")); $this->{myDataGrid}->DataBind; }
</script> <html> <body> <form runat="server"> <asp:DataGrid id="myDataGrid" runat="server" /> </form> </body> </htm
|