en_lang.jpg, 1 kB sk_lang.jpg, 1 kB
English Slovak

      Px Framework - ASP.NET components for rapid development of database applications


Menu:



Components of Px Framework:


PxWebQuery - component for working with databases



The PxWebQuery component is a component that allows fast working with a database, loading data from the database, their display and editing (line input, editing and deleting) or searching and selection of data. The PxWebQuery component contains a DataTable object to which the data, defined in the SQL command are loaded.

The PxWebQuery component is defined in the *. aspx file as follows:

<Prx:PxWebQuery ID="wquAdresar" runat="server" Value="wquAdresar"/>

If you want the Px Framework components to be visible in the aspx files, you have to define the "Prx" prefix in the header, as follows:

<%@ Register TagPrefix="Prx" Namespace="PxControls" Assembly="PxControls" %>

After this you can operate with the PxWebQuery component in the*. aspx.cs file as follows. First, enter the ConnectionString to the component and then the SQL command:

wquAdresar.ConnectString = "User Id=adr;Password=aa;Data Source=xe;";
wquAdresar.SQLSelect = "select idadresar, name, address, create_date from Adresar";

Then use the "Open" command to load data from the database to the component, and now you can connect it to the PxSuperGrid component, which displays the data retrieved.

Listing full of source code:

protected void Page_Load(object sender, EventArgs e)
{
  if ((!IsPostBack)&&(wquAdresar.Active==false))
  {
    wquAdresar.ConnectString = "User Id=adr;Password=aa;Data Source=xe;";
    wquAdresar.SQLSelect = "select idadresar , name, address, create_date from Adresar";

    wquAdresar.Open();
  }
  grdAdresar.PxDataSource = wquAdresar;
  grdAdresar.DataBind();
}



Here is a functional example of the PxWebQuery component, even with source code. This functional example on this site runs on MySQL 5.0 database.

No. Example Name Source Codes SQL Script
1.1. Adresar.aspx
Adresar.aspx.cs
SQLScript_MySQL.5.1
SQLScript_MySQL.5.0



Others articles of Px Framework:



It doesn't the intention of this part website, describe in detail the work with PxFramework components, a detailed description of the component available in manual, which can be downloaded here: Download manual of Px Framework