在我的项目中,我想使用ORM工具,但我的数据库在SQL Server 2000上运行。我无法使用Entity Framework和Linq。我可以使用ado.net。我想知道哪些ORM工具支持我的需求?
提前致谢。
答案 0 :(得分:0)
Telerik数据访问(免费)
Introducing Telerik Data Access
How to: Create Domain Model Based on MS SQL 2000 Database
using System.Linq;
using OpenAccessModel;
namespace ConsumerProject
{
class Program
{
static void Main(string[] args)
{
using (EntitiesModel dbContext = new EntitiesModel())
{
// Add a new Category.
Category newCategory = new Category();
newCategory.CategoryName = "New Category";
dbContext.Add(newCategory);
// Get the first Category using LINQ and modify it.
Category firstCategory = dbContext.Categories.FirstOrDefault();
firstCategory.CategoryName = firstCategory.CategoryName + "_Updated";
// Commit changes to the database.
dbContext.SaveChanges();
// Use LINQ to retrieve Category with name 'New Category'.
Category categoryToDelete = (from c in dbContext.Categories
where c.CategoryName == "New Category"
select c).FirstOrDefault();
// Delete the 'New Category'from the database.
dbContext.Delete(categoryToDelete);
// Commit changes to the database.
dbContext.SaveChanges();
}
}
}
}
是! LINQ支持MS SQL 2000数据库