You are on page 1of 3

Nama: Nurul Aliya Manurung

NIM: 1805114008
Kelas: CE-5C
Source Code:
web config:
<?xml version="1.0"?>

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->

<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
<connectionStrings>
<add name="cnsql" providerName="System.Data.SqlClient" connectionString="Data
Source=localhost;Initial Catalog=dbpelanggan;Persist Security Info=True;User
ID=sa;Password=123"/>
</connectionStrings>
</configuration>
Source:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="tabel.aspx.vb"
Inherits="pelanggan.tabel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"


AutoGenerateDeleteButton="True" AutoGenerateEditButton="True"
DataSourceID="SqlDataSource1" DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="KodePelanggan" HeaderText="KodePelanggan"
SortExpression="KodePelanggan" />
<asp:BoundField DataField="NamaPelanggan" HeaderText="NamaPelanggan"
SortExpression="NamaPelanggan" />
<asp:BoundField DataField="Alamat" HeaderText="Alamat"
SortExpression="Alamat" />
<asp:BoundField DataField="NoTelp" HeaderText="NoTelp"
SortExpression="NoTelp" />
<asp:BoundField DataField="Email" HeaderText="Email"
SortExpression="Email" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:cnsql %>"
SelectCommand="SELECT * FROM [tblpelanggan]"

UpdateCommand="UPDATE [tblpelanggan] SET


[KodePelanggan]=@KodePelanggan,[NamaPelanggan]=@NamaPelanggan,[Alamat]=@Alamat,[NoTelp]=@
NoTelp,[Email]=@Email WHERE [ID]=@ID"
DeleteCommand="DELETE FROM [tblpelanggan] WHERE [ID]=@ID"
></asp:SqlDataSource>

</div>
</form>
</body>
</html>

You might also like