Gridview control update command
Posted by: Brad Cunningham
Date: December 05, 2006 09:17AM

here is my code, deleting works fine, but when i update i get a

Exception Details: System.Data.Odbc.OdbcException: ERROR [HYT00] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]Truncated incorrect DOUBLE value: 'value'



here is my code for the gridview:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ikcConnectionString %>" ProviderName="<%$ ConnectionStrings:ikcConnectionString.ProviderName %>" SelectCommand="SELECT * FROM users" UpdateCommand="UPDATE users SET email = @email WHERE id = ?" DeleteCommand="DELETE FROM users WHERE id=?">

<UpdateParameters>
<asp:Parameter Name="email" Type="String"/>
<asp:Parameter Name="id" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>

<asp:GridView ID="GridUserTable" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="id" AllowSorting="True">
<Columns>
<asp:BoundField DataField="id" ReadOnly=True HeaderText="id" InsertVisible="False" SortExpression="id" />
<asp:BoundField DataField="username" HeaderText="username" SortExpression="username" />
<asp:BoundField DataField="numdogsallowed" HeaderText="numdogsallowed" SortExpression="numdogsallowed" />
<asp:BoundField DataField="experience" HeaderText="experience" SortExpression="experience" />
<asp:BoundField DataField="job" HeaderText="job" SortExpression="job" />
<asp:BoundField DataField="password" HeaderText="password" SortExpression="password" />
<asp:BoundField DataField="playername" HeaderText="playername" SortExpression="playername" />
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
<asp:BoundField DataField="money" HeaderText="money" SortExpression="money" />
<asp:BoundField DataField="ip" HeaderText="ip" SortExpression="ip" />
<asp:BoundField DataField="verified" HeaderText="verified" SortExpression="verified" />
<asp:BoundField DataField="IsAdmin" HeaderText="IsAdmin" SortExpression="IsAdmin" />
<asp:BoundField DataField="UserState" HeaderText="UserState" SortExpression="UserState" />
<asp:CommandField ShowEditButton="True" ShowDeleteButton="True" />
</Columns>

</asp:GridView>

Options: ReplyQuote


Subject
Written By
Posted
Gridview control update command
December 05, 2006 09:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.