protected void Button2_Click(object sender, EventArgs e)
{
Response.Write(Execute("SELECT NOW()"));
}
public string Execute(string storedProcedureName)
{
using (EntityConnection connection = (EntityConnection)new EGModel.EGEntity().Connection)
{
using (EntityCommand command = connection.CreateCommand())
{
command.CommandType = CommandType.Text;
command.CommandText = storedProcedureName;
connection.Open();
return command.ExecuteScalar().ToString();
}
}
}
我收到错误“查询语法无效。靠近第 1 行,第 13 列。”;我很好奇,为什么会出现这个错误?(Mysql实体连接)