linq to mySQL 如何欺骗 VB Express 使用它?
我目前正在使用 VB.NET Express 通过网络连接到 mySQL。只要我使用普通的 SQL 连接和语句就没有问题。
但当谈到LINQ 2 mySql时,我对VB Express的局限性感到震惊。
各位大师有什么线索吗?
I'm currently using VB.NET Express to connect to mySQL over the net. No problem as long as I use plain vanilla SQL connections and statements.
But when it comes to LINQ 2 mySql, I'm struck by VB Express's limitation.
Any clue you gurus?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要改用DBLinq、Entity Framework、或 nHibernate 而不是 Linq-to-SQL。 Linq-to-SQL 仅支持 SQL Server 和 SQL Server CE。这不是一个
Visual Studio Express 的局限性。实际上,据我所知,Express 版本的唯一限制是它们不支持任何 Visual Studio 插件 - 但就 CLR 功能而言,使用 Express 完全不受限制。而且,实体框架是内置的,可供您开箱即用。 stackoverflow 有关于 MySQL 连接器的信息。
You'll need to switch out to using something like DBLinq, Entity Framework, or nHibernate instead of Linq-to-SQL. Linq-to-SQL only supports SQL Server and SQL Server CE. This isn't a
limitation of Visual Studio Express at all. Actually, the only limitations I know of with the express editions are that they don't support any Visual Studio plug-ins - but as far as CLR features, you aren't limited at all using Express. And, Entity Framework is built-in and available for you to use out of the box. And stackoverflow has info on the MySQL connector.
经过几天的寻找,终于到达了圣杯!
由于 StackOverflow 的你们都是一群很棒的人,所以我为你们写了一些如何进行采样的内容。如下:
1 - 我发现的唯一合理、免费且有效的产品是 Devart LinqConnect Express 版本。
它是来自 www.devart.com 的免费产品,能够:(
请注意,我对它们没有特定的链接,也不感兴趣。)
从其自己推出的 Devart EntityDeveloper 免费版本生成数据上下文
(每个上下文的表数量有一些限制,如果我是对的,则为 10 个)。
将 LINQ dll 完成到 Visual Basic Express 版本,无需从数据源资源管理器创建数据源。
好的,安装完该包后,请按照以下步骤操作:
从 Program Files\Devart LinqConnect 启动实体设计器并从数据库创建模型。
保存模型并启动 VB Winform 项目。
添加以下 .NET 引用:
现在添加您在 Entity Developer 中创建的新 datacontext.designer.vb 文件
到项目:
右键单击解决方案资源管理器中的项目,然后选择
在表单上创建一个按钮和一个名为 dgv1 的 datagridview。
再多 5 行代码就可以了!
按钮代码:
其余的都是纯粹的装饰哈哈...
值得一提的是,虽然他们的产品很棒,但支持也很棒!
他们在不到 12 小时内回答了我的问题。
After a couple of days searching, Iv' finally reached the Saint Graal!
Since you guys at StackOverflow are so great a bunch of blokes, I've written a little how to sample for you. Here it is:
1 - The ONLY sensible, free and working product I've founr is Devart LinqConnect Express edition.
Its a free product from www.devart.com, capable of:
(Please note I have no particular links nor interest with them.)
Generating datacontext from its own embarked Devart EntityDeveloper free edition
(With some limits in number of tables per context, 10 if I'm right).
Complete the LINQ dlls into Visual Basic Express edition, without having to create a datasource from the datasource explorer.
Ok, once you've installed the package, here's the how to:
Launch the Entity designer from Program Files\Devart LinqConnect and create the model from the database.
Save the model and launch your VB Winform project.
Add the following .NET references:
Now add the new datacontext.designer.vb file you've created in Entity Developer
to the project:
Right-click the project in Solution Explorer and select
Create a button and a datagridview named dgv1 onto your form.
5 more lines of code and you're set!
Button code:
The rest is pure cosmetic LOL...
It is worth to mention that although their product is great, the support is great as well!
They answered my questions in less than 12 hours.