Please hlep as i cannot update the datagid in asp.net below is the code ,m not geeting where m a goin wrong.
After editing the Datagrid when i click on update the database is not updated.There is no error message.
Please help
>>>ASP.net Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>
</div>
<table>
<tr>
<td>
<asp:Label ID="id" runat="server" Text="ID"></asp:Label>
<asp:TextBox ID="t1" runat="server" ></asp:TextBox>
</td>
<asp:Label ID="nm" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="t2" runat="server" ></asp:TextBox>
<asp:Label ID="lnm" runat="server" Text="Last Name"></asp:Label>
<asp:TextBox ID="t3" runat="server" ></asp:TextBox>
</tr>
</table>
<asp:DataGrid ID="Dg1" runat="server" oncancelcommand="Dg1_CancelCommand"
oneditcommand="Dg1_EditCommand" onupdatecommand="Dg1_UpdateCommand">
<Columns>
<asp:BoundColumn HeaderText="ID" DataField="id">
</asp:BoundColumn>
<asp:BoundColumn HeaderText="NAME" DataField="name">
<asp:BoundColumn HeaderText="LAST NAME" DataField="last_name">
<asp:EditCommandColumn EditText="EDIT" CancelText="CANCEL" UpdateText="UPDATE" HeaderText="EDIT">
</asp:EditCommandColumn>
<asp:ButtonColumn CommandName="delete" HeaderText="DELETE" Text="DELETE">
</asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
</html>