Web Programing

  • Uploaded by: Alberto Moreno Cueva
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Web Programing as PDF for free.

More details

  • Words: 723
  • Pages: 43
Web Programing Ing. Alberto Moreno

Objetivo Mostrar las novedades en el desarrollo Web con el ASP.NET 2.0, el acceso a bases de datos y el lenguaje C#

Web Programing ASP.NET 2.0 implementa diversas funcionalidades para el desarrollador como productividad, administración y gestión, extensibilidad y desempeño

Productividad Nuevos controles de servidor Master Pages Themes y Skins Soporte para dispositivos móviles

Nuevos controles de servidor

Controles de Datos Controles de Navegación Controles de Login Controles de Web Parts

Administración y Gestión API de Configuración Herramienta de Admin MMC Herramienta de pre-compilación Tracing y Monitoreo

Otros Recursos Controles de Data Source Soporte 64-Bits Cache

Acceso a Bases de Datos Recursos:

 Clasificación, paginación y cache de datos  Actualización, eliminación e inserción de datos  Filtros, Master-Detail

Acceso a Bases de Datos Controles Data Source:

SqlDataSource ObjectDataSource AccessDataSource SiteMapDataSource XmlDataSource DataSetDataSource

Providers

Providers

Provider s

Provider s

DataSet tipado / TableAdapter

Acceso a Bases de Datos

Controles Data-bound:

GridView DetailsView FormView TreeView Menu

GridView

GridView

GridView
" UpdateCommand="UPDATE [Products] SET [ProductName] = @ProductName ..." SelectCommand="SELECT [ProductID], [ProductName] … FROM [Products]" InsertCommand="INSERT INTO [Products] ([ProductName] ..." DeleteCommand="DELETE FROM [Products] WHERE [ProductID] ...">


DetailsView

DetailsView

DetailsView

DetailsVie w

Data Source

Edit / Insert / New / Update

DetailsView
... "> ... ... ...


FormView

FormView

DataList

DataList OrderID: OrderDate: '/> ">

Objetos de Negocio using System.Data; using System.Data.SqlClient; public class DataAccess { public static DataSet GetCategories() { string conexao = "Database=northwind;server=(local);user id=sa "; string sql = "SELECT * FROM Categories"; SqlConnection conn = new SqlConnection(conexao); SqlCommand command = new SqlCommand(sql, conn); SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; } }

Objetos de Negocio public static DataSet GetProducts(int cat) { string conexao = "Database=northwind;server=(local);user id=sa"; SqlConnection conn = new SqlConnection(conexao); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = CommandType.Text; command.Parameters.Add(new SqlParameter("@cat", cat)); command.CommandText = "SELECT ProductID, ProductName, UnitPrice, UnitsInStock FROM Products WHERE categoryID=@cat"; SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet ds = new DataSet(); adapter.Fill(ds); return ds; }

Dropdown + GridView + DLL

Dropdown + GridView + DLL

TreeView + XML

asp.net dino esposito ms press sql reporting services tom cruise ms press

<%@ Page Language="C#" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %>

TreeView

<script runat="server"> const string conexao = "Server=localhost;Database=Northwind;user id=sa"; void Page_Load() { if (! Page.IsPostBack) FillNodes(); } void FillNodes() { DataSet dst = GetData(); foreach (DataRow masterRow in dst.Tables["Categories"].Rows) { TreeNode masterNode = new TreeNode((string)masterRow["CategoryName"]); TreeView1.Nodes.Add(masterNode); foreach (DataRow childRow in masterRow.GetChildRows("Children")) { TreeNode childNode = new TreeNode((string)childRow["ProductName"]); masterNode.ChildNodes.Add(childNode); } } }

TreeView DataSet GetData() { SqlConnection conn = new SqlConnection(conexao); string sqlCat = "Select CategoryID, CategoryName FROM Categories"; string sqlProd = "Select CategoryID, ProductName FROM Products"; SqlDataAdapter daCat = new SqlDataAdapter(sqlCat, conn); SqlDataAdapter daProd = new SqlDataAdapter(sqlProd, conn); DataSet ds = new DataSet(); daCat.Fill(ds, "Categories"); daProd.Fill(ds, "Products"); ds.Relations.Add("Children", ds.Tables["Categories"].Columns["CategoryID"], ds.Tables["Products"].Columns["CategoryID"]); return ds; }

TreeView

<script runat="server"> string conexao = "Database=northwind;server=(local);user id=sa"; void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { SqlConnection con = new SqlConnection(conexao); string sql = "SELECT EmployeeID, FirstName FROM Employees"; SqlCommand cmd = new SqlCommand(sql, con); con.Open(); using (con) { SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { TreeNode newNode = new TreeNode(); newNode.PopulateOnDemand = true; newNode.Text = reader["FirstName"].ToString(); newNode.Value = reader["EmployeeID"].ToString(); e.Node.ChildNodes.Add(newNode); } } }

Visual C# 2005

Visual C# 2005

Visual C# 2005

Visual C# 2005

Visual C# 2005

Related Documents

Web Programing
May 2020 18
Web Programing 2.pdf
June 2020 5
R-programing
June 2020 7
Programing C
August 2019 26

More Documents from ""