PDA

View Full Version : DataGrid not Updating


jilltre
11-24-2008, 10:07 PM
I've created a datagrid using the 'edit' option. When I click Edit, it does open up the record for me to edit, but when I click Update, nothing happens. It appears that nothing is being posted back to the database... I'm somewhat of a beginner with ASP in Dreamweaver, but can copy code if you need it...

Any suggestions or work arounds would be appreciated.

thanks!

Jill

mangofreak
12-06-2008, 05:55 PM
Take the update option off and apply it again. if that doesn't work, post your code.

Javier

jilltre
12-08-2008, 04:08 PM
I did as you suggested,, now I do receive an error message:

Untitled DocumentSystem.Exception: Unsupported TYPE attribute: undefined
at DreamweaverCtrls.DataSet.GetDbTypeFromString(Strin g str)
at DreamweaverCtrls.DataSet.OnDataGridUpdate(Object Src, DataGridCommandEventArgs E)

this pops up after I click update... I've attached the code.

<form id="form1" name="form1" method="post" action="" runat="server">
<asp:DataGrid AllowPaging="false"
AllowSorting="False"
AutoGenerateColumns="false"
CellPadding="3"
CellSpacing="0" DataKeyField="ID"
DataSource="<%# DataSet1.DefaultView %>" ID="DataGrid1"
runat="server"
ShowFooter="false"
ShowHeader="true" OnUpdateCommand="DataSet1.OnDataGridUpdate" OnEditCommand="DataSet1.OnDataGridEdit" OnCancelCommand="DataSet1.OnDataGridCancel" OnItemDataBound="DataSet1.OnDataGridItemDataBound"
>
<headerstyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<itemstyle BackColor="#F2F2F2" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<alternatingitemstyle BackColor="#E5E5E5" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<footerstyle HorizontalAlign="center" BackColor="#E8EBFD" ForeColor="#3D3DB6" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Bold="true" Font-Size="smaller" />
<pagerstyle BackColor="white" Font-Name="Verdana, Arial, Helvetica, sans-serif" Font-Size="smaller" />
<columns>
<asp:BoundColumn DataField="Date"
HeaderText="Date"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Name"
HeaderText="Name"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Time_Out"
HeaderText="Time_Out"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Description"
HeaderText="Description"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Notes"
HeaderText="Notes"
ReadOnly="false"
Visible="True"/>
<asp:BoundColumn DataField="Date_Entered"
HeaderText="Date_Entered"
ReadOnly="false"
Visible="True"/>
<asp:EditCommandColumn
ButtonType="LinkButton"
CancelText="Cancel"
EditText="Edit"
HeaderText="ID"
UpdateText="Update"
Visible="True"/>
</columns>
</asp:DataGrid>
</form>

mangofreak
12-13-2008, 03:30 AM
Sorry for the delay. Too busy at work.

I have noticed that your code is not ASP(classic ASP) but ASP.Net maybe?
Oops, not versed on that type of ASP but if I'm not mistaken seem that one of your values may be of the wrong data type. integer, text, date

Make sure your values are appropriate for the data type the database is expecting.

Good luck.