ASP.NET ile Kod Yazmadan Veritabanı İşlemleri

Önceki yıllarda yayınladığım bu videoyu sizlerle tekrar paylaşıyorum.

 

 

kmb-udemy-reklam

ASP.NET – SQL Data Source Kullanarak Kodsuz CRUD İşlemleri – 1

ASP.NET ‘de SQL Data Source Nesnesi ile kod yazmadan bir SQL veritabanı tablosu üzerinde SELECT (veri listeleme) , INSERT (veri ekleme), UPDATE (veri güncelleme), DELETE (veri silme) işlemlerinin nasıl yapılacağını anlatıyorum..

http://content.screencast.com/users/MaviSeffaf/folders/Default/media/ea82caca-fa65-4831-bdfb-f9d7363b0a19/mp4h264player.swf

Videoyu indir !

Dizayn :

Ekran Alıntısı

Kaynak Kod :

    <asp:SqlDataSource ID="sdsUserTable" runat="server" ConnectionString="" DeleteCommand="DELETE FROM [UserTable] WHERE [ID] = @ID"
        InsertCommand="INSERT INTO [UserTable] ([Name], [Surname], [Phone], [City]) VALUES (@Name, @Surname, @Phone, @City)"
        SelectCommand="SELECT * FROM [UserTable] ORDER BY [Name], [Surname]" UpdateCommand="UPDATE [UserTable] SET [Name] = @Name, [Surname] = @Surname, [Phone] = @Phone, [City] = @City WHERE [ID] = @ID">
        <asp:ControlParameter ControlID="GridView1" DefaultValue="-1" Name="ID" PropertyName="SelectedValue"
            Type="Int32" />
        <asp:ControlParameter ControlID="GridView1" DefaultValue="" Name="Name" PropertyName="SelectedValue"
            Type="String" />
        <asp:ControlParameter ControlID="GridView1" Name="Surname" PropertyName="SelectedValue"
            Type="String" />
        <asp:ControlParameter ControlID="GridView1" Name="Phone" PropertyName="SelectedValue"
            Type="String" />
        <asp:ControlParameter ControlID="GridView1" Name="City" PropertyName="SelectedValue"
            Type="String" />
        <asp:ControlParameter ControlID="GridView1" DefaultValue="-1" Name="ID" PropertyName="SelectedValue"
            Type="Int32" />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            Caption="Ki?iler" CellPadding="4" DataKeyNames="ID" DataSourceID="sdsUserTable"
            EmptyDataText="Kay?t yok.." EnableModelValidation="True" ForeColor="#333333"
            HorizontalAlign="Center" PageSize="2" ShowFooter="True">
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                SortExpression="ID" Visible="False" />
            <asp:BoundField DataField="Surname" HeaderText="Surname" SortExpression="Surname" />
            <asp:TextBox ID="TextBox1" runat="server" Text=''>
                <asp:LinkButton ID="lnkYeni" runat="server" ForeColor="White" onclick="lnkYeni_Click">Yeni                                                               
<asp:Label ID="Label1" runat="server" Text=''>