i successfully connect mysql to visual studio 2008 with membership registration, But when i try to databing to gridview it pop up the following error
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 '[accountdetails]' at line 1
ultimate_dev...
Member
49 Points
73 Posts
You have an error in your SQL syntax
Feb 14, 2012 11:13 AM|LINK
i successfully connect mysql to visual studio 2008 with membership registration, But when i try to databing to gridview it pop up the following error
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 '[accountdetails]' at line 1
here is my 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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:hsbcdbConnectionString %>"
ProviderName="<%$ ConnectionStrings:hsbcdbConnectionString.ProviderName %>"
SelectCommand="SELECT * FROM [accountdetails]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
any suggestion plz
ksqcoder
Participant
1292 Points
207 Posts
Re: You have an error in your SQL syntax
Feb 14, 2012 11:29 AM|LINK
You could try "SELECT * FROM accountdetails" instead, losing the brackets.
ultimate_dev...
Member
49 Points
73 Posts
Re: You have an error in your SQL syntax
Feb 14, 2012 01:28 PM|LINK
can u help me on this
http://forums.asp.net/t/1769419.aspx/1?You+have+an+error+in+your+SQL+syntax+Again+