Hey,
I`m trying to use MySql database in asp but I keep getting this error:
The server tag is not well formed
I think my problem is that I cant connect to mysql! Does anyone know how to use mysql database in asp.net?
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Grid View</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:MySqlDataSource ID="MySQLDataGrid" Runat="server"
ProviderName = "MySql.Data.MySqlClient";
ConnectionString = "server=localhost;database=company;UID=root;password=******"
SelectCommand = "SELECT client.name, employee,sex, remark,owner, birth FROM client INNER JOIN event ON client.name = event.name ";
UpdateCommand = "UPDATE client SET employee = @employee, owner =
@owner, sex = @sex,remark = @remark,
birth = @birth, WHERE name =
@name" >
<UpdateParameters>
<asp:Parameter Type="String"
Name="name"></asp:Parameter>
<asp:Parameter Type="String"
Name="employee"></asp:Parameter>
<asp:Parameter Type="String"
Name="owner"></asp:Parameter>
<asp:Parameter Type="String"
Name="sex"></asp:Parameter>
<asp:Parameter Type="String"
Name="remark"></asp:Parameter>
<asp:Parameter Type="String"
Name="birth"></asp:Parameter>
</UpdateParameters>
</asp:MySqlDataSource>
<asp:GridView ID="gdvClient" Runat="server"
DataSourceID="MySQLDataGrid" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="name" >
<PagerStyle BackColor="Gray" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="Black"
ForeColor="White" />
<AlternatingRowStyle BackColor="LightGray" />
<Columns>
<asp:CommandField ButtonType="Button"
ShowEditButton="true" />
<asp:BoundField Visible="false"
HeaderText="name" DataField="name"
SortExpression="name">
</asp:BoundField>
<asp:BoundField HeaderText="Employee"
DataField="employee"
SortExpression="employee">
</asp:BoundField>
<asp:BoundField HeaderText="owner"
DataField="owner"
SortExpression="owner">
</asp:BoundField>
<asp:BoundField HeaderText="sex"
DataField="sex"
SortExpression="sex">
</asp:BoundField>
<asp:BoundField HeaderText="remark"
DataField="remark"
SortExpression="remark">
</asp:BoundField>
<asp:BoundField HeaderText="birth"
DataField="birth"
SortExpression="birth">
</asp:BoundField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>