Mysql & gridview

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=?">

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

<asp:GridView ID="GridUserTable" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="id" AllowSorting="True">
<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" />

12/5/2006 5:58:53 PM 1929 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 8

I think it is because MySQL doesn't support the @paramname syntax. Try ?paramname instead.
When your question has been sufficiently answered, please be sure to mark your question as answered. Also, please share your solution if you had to figure it out on your own!
12/5/2006 7:07:40 PM

now i get

ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.27-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'email WHERE id='1'' at line 1



    ConnectionString="<%$ ConnectionStrings:ikcConnectionString %>"
    ProviderName="<%$ ConnectionStrings:ikcConnectionString.ProviderName %>"
    SelectCommand="SELECT id, email FROM users"
    UpdateCommand="UPDATE users SET email=?email WHERE id=?"
    DeleteCommand="DELETE FROM users WHERE id=?">
        <asp:Parameter Name="id" Type="String" />
        <asp:Parameter Name="email" Type="String"/>
    <asp:GridView ID="GridUserTable" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" AllowSorting="True" DataKeyNames="id">
            <asp:CommandField ShowEditButton="True" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" SortExpression="id"  />
            <asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />


12/5/2006 10:56:19 PM

I don't think MySQL ODBC 3.51 supports named parameters. Try: "UPDATE users SET email=? WHERE id=?"

Also, you may need to play with the order of the parameters in <UpdateParameters>.


When your question has been sufficiently answered, please be sure to mark your question as answered. Also, please share your solution if you had to figure it out on your own!
12/8/2006 7:02:53 PM

Similar Artilces:

Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit,

Redhat & perl-DBD-mysql (DBD::mysql)
We've been very successfully running Bugzilla 2.18 (just upgraded to 2.18.2 this morning). It's running on a RedHat 9 box using mysql 3.23.58 (from redhat RPMs). It's currently got DBD::mysql v2.1021 installed and that works fine. However, I wanted to test out the 2.20rc 1 build. So I made a second database instance, copied the entire bugzilla tree, adjusted the localconfig file to use the new database instance, and then checked it out. It's up and running 2.18 fine. So I updated with CVS to get the 2.20rc1 release. Now's the issue. The version of DBD::mysq...

mysql php5-mysql
Hi, i have installed mysqk from binaries itworks!!! but now how can i install php5-mysql and dependencies? Many thanks Thierry -- trazomtg ------------------------------------------------------------------------ When you say from the binaries, do you mean you installed via Yast and the Suse repositories?? It is always best to install via Yast-Software-Software Management if you can. This way all dependencies are done for you. -- gogalthorp ------------------------------------------------------------------------ gogalthorp's Profile: http://forums.opensuse....

Any Grid for MySQL in .Net except the gridview in VS2005???
i using Connector 5.0.7, and if i use gridview to display the db data,the sorting,paging function all cant be use. any other tools to intro ? which can support for MySQL paging,sorting and other function. i found RadGrid, but i not sure it can fully utilize under MySQL or not? anyone try it before?C####################################### No one can help???C#######################################...

[rfc] Net::MySQL & DBD::mysqlPP
Net::MySQL - Pure Perl MySQL client network protocol interface for the Perl DBD::mysqlPP - Pure Perl MySQL driver for the Perl Database Interface (DBI) Net::MySQL and DBD::mysqlPP is a Pure Perl client interface for the MySQL database. This module implements network protool between server and client of MySQL, thus you don't need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. ...

MySql, SqlDataSource, GridView, & VWD 2008 Express
Good afternoon, everyone.  I am new to the forums, though not to the site.  I *FINALLY* have a project that I can use to learn more about, albeit a home project.  I have created a MySQL database called "media" which will house all of my digital media (music, audiobooks, etc) as well as potentially my DVD & book collection.  The first table to have data is the "music" table, which contains the following columns:DROP TABLE IF EXISTS `media`.`music`;CREATE TABLE  `media`.`music` (  `music_id` smallint(5) unsigned NOT NULL AUTO_INCREM...

Problems w code behind & MySql Connector.Net
Hi, I've installet MySql Connector.Net and I'm using it successfully in those scripts where I don't split the code from the presentation, but when I try to import MySql.Data namespace into code behind it's NOT working. Imports MySql.Data.MySqlClient gives an error in code behind while <%@ import Namespace=MySql.Data.MySqlClient %> works alright. Any ideas? Any workarounds? TIA Ohlywohly and the error is? The error is a curvy line under the MySql.Data.MuSqlClient. well, there's a typo! What do you mean with A**? it is a word that neither I, nor the FC...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

------=_NextPart_000_0026_01C30A6E.486AE070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone run into this problem=20 $mysql->query(q{ INSERT INTO dbname (table_name) VALUES ( $var ) }); The problem is, when I assign a value to a $var that value is ignored in = the SQL statement. Ive tried every operator I know to get it to look at = it and accept the value as input into the DB. Ive tried=20 ( '$var' ) ("$var") ("\$var") ([$var]) ({$var}) Any ideas ? Kind regards...

linked server MySql to Mysql
Can i make linked server from MySql to another Mysql server?...

MySQL and Gridview
Dear All,  I would like to use the MySQL .net connector to connect to my MySQL database. I can get the connection set up and display data from a table using the Gridview. But, I cannot control the layout options such as paging, insertion, editing and deletion. Is there a way that this can be achieved? The code that I have been using to connect to my MySQL database is below:  <%@ Page Language="VB" debug="true" %> <%@ Import Namespace = "System.Data" %> <%@ Import Namespace = "MySql.Data.MySqlClient" %><script languag...

Suse MySQL and MySQL workbench
I am looking at the downloads here 'MySQL :: Download MySQL Workbench' ( and 'MySQL :: Download MySQL Community Server' ( As one is source code and the other is suse enterprise linux, are these the best downloads for MySQL on suse 11.3? Is there a best source for the install? Suse specific rpm's? -- flebber ------------------------------------------------------------------------ Try zypper or YAST first to look at the OpenSuSE repositories. ... 2005 & GridView & HyperLinkField & click event
Gang:I am trying to click on a HLF in a GV; however, I am unable to capture the declaration/click event.If I throw a test button on the page, the code behind for that click event fires off the code.How do I capture the click event for the HLF in the GV? What declaration/event am I trying to capture?A+ BS MCSE OOP Security+ Web DeveloperGet creative, not even. Hey,You can't capture the click event for HyperlinkField; HyperLink controls don't have a click event.Brian"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, ...

Perl Mysql
Hi all, I am installing Bugzilla3 on a windowsXP box together with Mysql5.0.45 and ActivePerl- It passed the checksetup and created the database. However, when I point my Firefox to http://localhost/ I got the following error: install_driver(mysql) failed: Can't load 'C:/Perl/site/lib/auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/Perl/lib/ line 230. at (eval 34) line 3 Compilation failed in require at (eval 34) line 3. Perhaps a required shared library or dll isn't installed...

Web resources about - Mysql & gridview -

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012 - Upcoming stories is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 11/29/2015 9:35:59 AM