易截截图软件、单文件、免安装、纯绿色、仅160KB

How to use MySql via Linq to SQL

The vs2008 and vs2010 don't support the generation LINQ to SQL business objects from a MySQL database, if you drop a MySql table to a Linq to Sql Class, it will popup a "The selected object(s) use an unsupported data provider" error.
Generation tool DBLinq
DbLinq is a LINQ to SQL data context provider and allows you to create LINQ to SQL business objects from a MySQL database and perform LINQ queries directly against MySQL tables. Utilizing LINQ, it functions in the same way as a typical SQL Server data layer.
a) Download DBLinq from: http://code.google.com/p/dblinq2007/downloads/list
b) Run the LINQ to SQL generation tool DbMetal.exe as follows:
DbMetal.exe -provider=MySql -database:MyDatebase -server:you host computer -user:mysql user -password:you pwd -namespace:mysqllinq -code:mysqllinq.cs -sprocs
Modify the generated file
The generated file can't be use in project right now, we must take some modification on it.
a) Delect all code with #if !MONO_STRICT(take MONO_STRICT as True is ok).
b) Delete the constructors from the DataContext class and add the following constructor:
        public MyDBDataContext()
            : base(new MySqlConnection(ConfigurationManager.ConnectionStrings["MyDb"].ConnectionString))
        {
        OnCreated();
        }
c) For "Incorrect AutoSync specification for member" error, we should set AutoSync of pk field as AutoSync.OnInsert, the full configuration for pk field:
[Column(Storage = "_userID", Name = "userId", DbType = "int", IsPrimaryKey = true, AutoSync = AutoSync.OnInsert, CanBeNull = false)]
As the .NET compiler will convert the code into a SQL Server syntax statement, run this code under MySql will throw error(Like this issue:http://lists.mysql.com/mysql/215385


相关文档:

Mysql替代解决方案Cassandra

http://incubator.apache.org/cassandra/
http://zh.wikipedia.org/wiki/Cassandra
Apache Cassandra是一套开源分布式数据库管理系统。它最初由Facebook开发,用于储存特别大的数据。
主要特性:
分布式
基于column的结构化
高伸展性
Cassandra的主要特点就是它不是一个数据库,而是由一堆数据库节点共同构成的一 ......

Twitter用户暴增20倍 欲弃用MySQL数据库

     Twitter公司一位名叫Ryan King的工程师日前向博客MyNoSQL透露,公司计划从MySQL迁移到Cassandra数据库,因为后者具有更大的弹性、可扩展性和大量的社区网络开源开发人员。
我们有大量的数据,在数据巨大,增长率正在加速的情况下,我们需要一个系统,它可以更为自动化,并高度可靠、可用。Ryan K ......

windows 7下如何安装Apache + PHP + MySQL + SVN等等

近来对php比较感兴趣,就断断续续的花了两个星期的时间把整个php开发需要用到的东西都装好了,大概的安装过程如下。
一、安装的软件:
Apache: 2.2.14
PHP:5.2.12
MySQL:5.1.42。
SVN:1.5.6
PHPMyAdmin:3.2.5
Zend Studio: 7.1
Zend Debugger: 5.1.14
二、安装过程:
1. 安装和配置apache
安装:首先从http://apa ......

Mysql锁机制

mysql锁机制
mysql中对表级的存储引擎来说是释放死锁的,避免死锁可以这样做到:在任何查询之前先请求锁,并且按照请求的顺序锁表。
Mysql中用于write(写)的表锁的实现机制如下:
如果表没有加锁,那么就加一个写锁。否则的话,将请求放到写锁队列中。
mysql中用于read(读)的表锁的实现机制如下:
如果表没有加锁,那么 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号