在尝试将
mysql数据库连接到编辑器时,会收到此错误,以下是代码:
protected void Button1_Click(object sender,EventArgs e) { DataTable dt = new DataTable(); MysqLConnection conn = new MysqLConnection(@"connection string");//tested and working conn.Open(); MysqLCommand cmd = new MysqLCommand("SELECT tes FROM ins"); MysqLDataAdapter da = new MysqLDataAdapter(cmd); da.SelectCommand = cmd; da.Fill(dt); if (dt.Rows.Count > 0) { Editor1.Content = dt.Rows[0]["tes"].ToString(); } conn.Close(); }
<body> <form id="form1" runat="server"> <cc1:Editor ID="Editor1" runat="server" Height="400px" Visible="true" /> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> </form>
我做错了什么事,谢谢提前.
我正在使用asp.net 3.5.