“selectedData” XPO DevExpress to ListView


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
using WebDevExp.Entity.apotek2;

public partial class Account_View : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
            Session session = new Session();
            XpoDataSource1.Session = session;

            SelectedData result = XpoDataSource1.Session.ExecuteQuery("Select id,username FROM apotek2.dbo.account");
            XPDataView dv = new XPDataView();
            dv.AddProperty("id", typeof(int));
            dv.AddProperty("username", typeof(string));

            ListViewAccount.DataSource = dv;


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="View.aspx.cs" Inherits="Account_View" %>

<%@ Register Assembly="DevExpress.Xpo.v13.1.Web, Version=, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Xpo" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <asp:ListView ID="ListViewAccount" runat="server">
                    <td><%# Eval("id") %></td>
                    <td><%# Eval("username") %></td>
        <dx:XpoDataSource ID="XpoDataSource1" runat="server"></dx:XpoDataSource>


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s