aps[1]
aps[1]
SqlClient
Imports System.Data.SqlClient.SqlException
Imports System.Data
End Sub
con.Open()
Else
cm.ExecuteNonQuery()
con.Close()
TextBox1.Text = ""
TextBox2.Text = ""
MsgBox("Success", MsgBoxStyle.Information, "Success...")
End If
End Sub
con.Open()
cm.ExecuteNonQuery()
con.Close()
MsgBox("Update Success", MsgBoxStyle.Information, "Success...")
End Sub
con.Open()
cm.ExecuteNonQuery()
con.Close()
MsgBox("Delete Success", MsgBoxStyle.Information, "Success...")
End Sub
End Class
design file
 
;
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px"
CellPadding="3" CellSpacing="2">
<Columns>
<asp:BoundField DataField="id" HeaderText="id" SortExpression="id" />
<asp:BoundField DataField="name" HeaderText="name"
SortExpression="name" />
<asp:BoundField DataField="city" HeaderText="city"
SortExpression="city" />
<asp:ButtonField ButtonType="Button" CommandName="Select"
HeaderText="select"
ShowHeader="True" Text="select" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<table class="style1">
<tr>
<td class="style3">
<asp:Label ID="Label1" runat="server" Text="Id"></asp:Label>
</td>
<td class="style5">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
<td class="style4">
</td>
<td class="style4">
</td>
<td class="style4">
</td>
</tr>
<tr>
<td class="style7">
name</td>
<td class="style8">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td class="style9">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="TextBox1" ErrorMessage="please enter name"
ForeColor="Red"
ValidationGroup="i1"></asp:RequiredFieldValidator>
</td>
<td class="style9">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style6">
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="style10">
city</td>
<td class="style11">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td class="style12">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="TextBox2" ErrorMessage="please enter city"
ForeColor="Red"
ValidationGroup="i1"></asp:RequiredFieldValidator>
</td>
<td class="style12">
</td>
<td class="style12">
</td>
</tr>
<tr>
<td class="style2">
<asp:Button ID="Button1" runat="server" Text="Button"
ValidationGroup="i1" />
<asp:Button ID="Button2" runat="server" Text="fetch" />
</td>
<td class="style6">
<asp:Button ID="Button3" runat="server" Text="Update" />
 
;
<asp:Button ID="Button4" runat="server" Text="Delete" />
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</form>
</body>
</html>