.NET,C#,LINQ,SQL和OR-映射 - 我只是不明白这一点:( [英] .NET, C#, LINQ, SQL and OR-Mapping - I just don't get it :(

查看:224
本文介绍了.NET,C#,LINQ,SQL和OR-映射 - 我只是不明白这一点:(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是不明白这一点,我甚至不知道我是否正在寻找正确的方向前进......

I just don't get it, and I'm not even sure if I'm looking in the right direction...

问题:

因此​​,有我的C#应用​​程序。我通过SSH连接到网上的MySQL数据库。现在,我可以运行使用MySQL连接器/ .NET驱动程序(http://dev.mysql.com/downloads/connector/net/5.2.html)就可以查询的东西。一切工作正常。

So there is my C# Application. I connect to an online MySQL database via SSH. Now I can run query-stuff on it using the MySQL Connector/.Net driver (http://dev.mysql.com/downloads/connector/net/5.2.html). Everything works fine.

现在我想一些OR-映射:我想运行在本地实体querys。

Now I want to some OR-Mapping: I want to run the querys on local entities.

例如:在在线数据库中,有表秩序,它有属性ORDER_TOTAL'和'ORDER_DATE

For example: In the online database, there is the table 'order' and it has the attributes 'order_total' and 'order_date'.

现在我经营的是SELECT * FROM命令

Now I run a "SELECT * FROM order"

接下来是什么?我怎样才能把这个结果转换为实体,然后写回修改后,我已经修改了它?所有我能找到直到现在,也就是有不治本的LINQ和(也许)XML。但我只是不明白整个事情:(

What's next? How can I turn this result into an entity and then write back the changes after I have modified it? All I could find out until now is, that is has to do someting with LINQ and (maybe) XML. But I just don't get the whole thing :(

我AP preciate每一个暗示或者一个简单的例子:)

I appreciate every hint or maybe a short example :)

在此先感谢!

推荐答案

你所想的,我想,是LINQ到SQL。但是,这仅适用于SQL Server中。

What you are thinking of, i think, is Linq to Sql. But that ONLY works for SQL Server.

http://www.mikeborozdin.com/post/LINQ-To- MySQL.aspx

因此​​,要构建对象出来的数据,你从你的MySQL服务器获取,然后做标准的LINQ to对象,你唯一的选择做你的映射。

So your only option to build objects out of the data that you get from your MySql server, and then do standard linq to objects to do your mapping.

希望这会有所帮助, 欢呼声中,

Hope this helps, Cheers,

这篇关于.NET,C#,LINQ,SQL和OR-映射 - 我只是不明白这一点:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆