Example of ASP. NET/Perl. NET database access

Source: Internet
Author: User

ASP. NET/Perl. NET Database Access Example
One of the features of. NET framework is its ability to handle multiple ages. third party compiler vendors can create and implement a compiler targeted for. NET runtime. in fact, over the course of the next year, you can see some 28 languages ages ported to. 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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.