i any problem in myscript, data not display when klick swicth kategori,
thereabouts where problem's my script
script :
<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Getkategori_Click(Sender As Object, E As EventArgs)
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim SelectCommand As String = "select * from buku where kategori =
@kategori"
MyCommand = New SqlDataAdapter(SelectCommand, MyConnection)
MyCommand.SelectCommand.Parameters.Add(New SqlParameter("@kategori",
SqlDbType.NVarChar, 2))
MyCommand.SelectCommand.Parameters("@kategori").Value = Myselect.Value
DS = new DataSet()
MyCommand.Fill(DS, "buku")
MyDataGrid.DataSource=DS.Tables("buku").DefaultView
MyDataGrid.DataBind()
End Sub
</script>
<html>
<head>
</head>
<body style="FONT: 10pt verdana">
<form runat="server">
<h3><font face="Verdana">Buku Per Kategori</font>
</h3>
Select a Kategori:
<select id="MySelect" runat="server">
<option>Komik</option>
<option>Relaksasi</option>
<option>Sastra</option>
<option>Novel Lokal</option>
<option>Novel Import</option>
<option>Dunia Usaha</option>
<option>Kesehatan</option>
<option>Psikologi</option>
<option>Pendidikan</option>
</select>
<input type="submit" value="Kategori" runat="server"
onserverclick="getkategori_click" />
<p>
<ASP:DataGrid id="MyDataGrid" runat="server"
EnableViewkategori="false" HeaderStyle-BackColor="#6699ff" Font-Size="8pt"
Font-Name="Verdana" CellSpacing="0" CellPadding="3" ShowFooter="false"
BorderColor="black" BackColor="#ccccff" Width="700"></ASP:DataGrid>
</p>
</form>
</body>
</html>