通过 SmartDeviceProject 出现 MissingManifestResourceException?
我是 SmartDeviceProject 的新手。因此,当我尝试将 MySQL 连接到我的项目时,在下面的代码中通过 Connection.open 出现 MissingManifestResourceException?
string connectionString = "server=192.168.1.100;database=mcubic;User Name=mcubic;Password=mcs@2011$;";
string query = "select b.Outlet_Master_Name from mcs_user_outlet a,outlet_master b where a.Mcs_User_Outlet_User_Id=3 and a.Mcs_User_Outlet_Outlet_Id = b.Outlet_Master_Id";
MySqlConnection connection = new MySqlConnection(connectionString);
MySqlCommand command = new MySqlCommand(query, connection);
connection.Open();
MySqlDataReader Reader = command.ExecuteReader();
while (Reader.Read())
{
comboBox1.Items.Add(Reader[0].ToString());
}
connection.Close();
我该如何解决这个问题,。我为此项目导入了 MySql.Data.CF.dll。
I am new to SmartDeviceProject. So When i try to connect MySQL to my project, MissingManifestResourceException through in Connection.open in below code?.
string connectionString = "server=192.168.1.100;database=mcubic;User Name=mcubic;Password=mcs@2011$;";
string query = "select b.Outlet_Master_Name from mcs_user_outlet a,outlet_master b where a.Mcs_User_Outlet_User_Id=3 and a.Mcs_User_Outlet_Outlet_Id = b.Outlet_Master_Id";
MySqlConnection connection = new MySqlConnection(connectionString);
MySqlCommand command = new MySqlCommand(query, connection);
connection.Open();
MySqlDataReader Reader = command.ExecuteReader();
while (Reader.Read())
{
comboBox1.Items.Add(Reader[0].ToString());
}
connection.Close();
How do i solve this,. I am imported MySql.Data.CF.dll for this project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 MSDN 论坛的 Krish Kapadia:
解决方案:
这是链接:
http://dev.mysql.com/downloads/connector/ net/5.2.html
我在“mysql.user”表中插入了一个条目,其中主机名将为“%”(意味着任何用户都可以连接到 mysql)。如果你不想插入带有主机名的条目,那么你必须插入所有应该被允许连接到 mysql 的 IP 地址。
在“mysql.user”中插入条目后,我重新启动了 MySQL 服务。
然后尝试连接到 mysql 并已连接....
来源:
http://social.msdn.microsoft.com/Forums/eu/netfxcompact/thread/66f6386a-9963-4c2f-8d39-1c507a26a6c7
Via Krish Kapadia from MSDN forums:
Solution :
here is the link :
http://dev.mysql.com/downloads/connector/net/5.2.html
I have inserted one entry in 'mysql.user' table in which hostname will be '%' (means any user can connect to mysql). If you don't want to insert entry with hostname then you have to insert for all ip addresses who should be allowed to connect to mysql.
After inserting entry in 'mysql.user', I restarted MySQL service.
And then trying to connect to mysql and Connected....
source:
http://social.msdn.microsoft.com/Forums/eu/netfxcompact/thread/66f6386a-9963-4c2f-8d39-1c507a26a6c7