教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp.net  >  正文 ASP.NET/Perl.NET 数据库访问例子

ASP.NET/Perl.NET 数据库访问例子

发布时间:2016-12-05   编辑:jiaochengji.com
教程集为您提供ASP.NET/Perl.NET 数据库访问例子等资源,欢迎您收藏本站,我们将为您提供最新的ASP.NET/Perl.NET 数据库访问例子资源
ASP.NET/Perl.NET Database Access Example
One of the features of the .NET framework is its ability to handle multiple languages. Third party compiler vendors can create and implement a compiler targeted for the .NET runtime. In fact, over the course of the next year, you can expect to see some 28 languages ported to the .NET runtime. This will allow companies with a huge codebase in a "non-Microsoft language" to continue building onto their investment.
NOTE: All of the software required to create and run ASP.NET pages built using PERL.NET can be downloaded here.
Here is the code for the whole page (we will dissect and explain each bit of the code throughout the rest of the article):
<%@ 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>

您可能感兴趣的文章:
ASP.NET/Perl.NET 数据库访问例子
asp.net性能优化方法-数据库访问性能优化
vb.net使用DataGrid控件访问数据库的例子
JDBC数据库访问例子
vb.net实例代码 连接访问数据库文件(mdb)
MySQL数据库设置远程访问权限的方法
asp.net无法加载oci.dll的解决方法
ASP.NET 入门的五个步骤
asp.net在线备份、压缩与修复access数据库
ASP.NET 2.0中的登陆控件简介

[关闭]
~ ~