Linq ile devam ediyorum:

Ling SQL Data Class (.dbml Creat ettim,tercihen)

Object add: (ToolBox–>Data–>LinqDataSource)

<asp:LinqDataSource
    ContextTypeName=”AdventureWorksDataContext”
    TableName=”Contacts”
    ID=”LinqDataSource1″
    runat=”server”>
</asp:LinqDataSource>

Cs  Example Codes:

public class MovieLibrary
{
    string[] _availableGenres = { “Comedy”, “Drama”, “Romance” };

    public MovieLibrary()
    {
    }

    public string[] AvailableGenres
    {
        get
        {
            return _availableGenres;
        }
    }
}
Değişiklik:

<asp:LinqDataSource
    ContextTypeName=”MovieLibrary”
    TableName=”AvailableGenres”
    ID=”LinqDataSource1″
    runat=”server”>
</asp:LinqDataSource>

Binding:

<asp:LinqDataSource
    runat=”server”
    ContextTypeName=”AdventureWorksDataContext”
    TableName=”Contacts”
    ID=”LinqDataSource1″>
</asp:LinqDataSource>
<asp:GridView
    ID=”GridView1″
    runat=”server”
    DataSourceID=”LinqDataSource1″ >
</asp:GridView>

Advanced:

<asp:LinqDataSource
    ContextTypeName=”AdventureWorksDataContext”
    TableName=”Products”
    ID=”LinqDataSource1″
    runat=”server”>
</asp:LinqDataSource>
<asp:GridView
    DataSourceID=”LinqDataSource1″
    AutoGenerateColumns=”false”
    ID=”GridView1″
    runat=”server”>
    <Columns>
        <asp:BoundField DataField=”Name” />
        <asp:BoundField DataField=”StandardCost” />
    </Columns>
</asp:GridView>

Başka Ne yapılabilir:

<asp:LinqDataSource 
  ContextTypeName="ExampleDataContext" 
  TableName="Products" 
  GroupBy="ProductCategory"
  Select="new(Key, 
    Average(ListPrice) As AverageListPrice, 
    Average(Cost) As AverageCost, 
    Count() As RecordCount)"
  ID="LinqDataSource1" 
  runat="server">
</asp:LinqDataSource>

 

Aggregate Methods

The following table lists the aggregate methods that are available when you use the LinqDataSource control.

Aggregate function Description
Count() Returns the total number of records for a set of data.
Average(column) Returns the average value of the specified column for all returned records.
Sum(column) Returns the value from adding all the values in the specified column for all returned records.
Max(column) Returns the maximum value for the specified column for all returned records.
Min(column) Returns the minimum value for the specified column for all returned records.
Where(condition) Filters the returned records based on the specified condition.
Any() Determines whether the collection contains any records.
All(condition) Determines whether all records in the collection satisfy the specified condition.

Sihirbazla da aşağıdaki gibi yapabiliriz fakat Entity gerekir:

Bazı günlük kullanım notlarım:

Datetime convertlerinde Parse kullanmak platformdan bağımsız yönetim sağlamaktadır.

Datetime.ToString(“ddd”)==> Türekçe cmt,İng sat verir.

Devam:

Application State  Application[“Visitors”]=0; //Uygulama bazında herkes erişebilir,Session =>Kişiye  Özgü
 -Responce.Cookies[“firstname”].Value=”patrick”;
-Response.Cookies[“firstname”].Expires=DateTime.Now.AddDays(5);
 -Cache[“key1”]=myValue;

Sıradaki Konular:

-WCF

Page output caching  *
%@OutputCache Duration=”900″ varyByParam=”None”%
 -get,set**
 -Generic Handlers
 -Custom HTTP handler
 -Configuring Projects
-Propery.Pages
-Menü–> Website–>ASP.NET Configuring
-ASP.NET Providers
Services–> Membership,Sitemaps,Profile
 Authentication:Windows Integrated Auth.,Forms Auth.
 Identy:Impersonation,Authorization
 -Configuring Application Pools
 -Servislerde  ASP.NET State Services  session state