using System;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xrm;
using Microsoft.Xrm.Client;

namespace ToolsCRM.user_sites
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var xrm = new XrmServiceContext("Xrm");


            var konkurent = new Competitor
            {
                Name="Intel"
            };
            xrm.AddObject(konkurent);
            xrm.SaveChanges();
            
            
            var articles =
                (from article in xrm.CompetitorSet
                 select article);

            GridView1.DataSource = articles;
            GridView1.DataBind();
        }
        
    }
}