我正在尝试从C#应用程序查询MySql数据库。下面是我正在使用的代码
public class GetNameController : ApiController
{
[HttpGet]
public HttpResponseMessage GetName(string J_No)
{
List<MySqlParameter> prms = new List<MySqlParameter>();
prms.Add(new MySqlParameter("J_No", MySqlDbType.VarChar, J_No, ParameterDirection.Input));
string connStr = ConfigurationManager.ConnectionStrings["DB-connectionString"].ConnectionString;
using (MySqlConnection dbconn = new MySqlConnection(connStr))
{
DataSet userDataset = new DataSet();
var strQuery = "SELECT * from Name_View where where Number = :J_No ";
我之前使用Oracle DB连接做了这样的事情。但是使用上面的代码我在prms.Add()
喜欢
The best overloaded method match for 'MySql.Data.MySqlClient.MySqlParameter.MySqlParameter(string, MySql.Data.MySqlClient.MySqlDbType, int, string)' has some invalid arguments