Home > Net >  Domestic of dream DM8 version support ADO.NET entity data model of database connection?
Domestic of dream DM8 version support ADO.NET entity data model of database connection?

Time:11-12

Everybody is good, ask a question, can you tell me the ADO.NET entity data model can connect the domestic DM8 database of dream, only to know that can connect to the SQL server, mysql, oracle database series, didn't find the related information for dream database currently, I do not know the current domestic DM8 versions of a dream to support the connection to ADO.NET entity data model? Thank you very much!

CodePudding user response:

Even can be directly,

CodePudding user response:

@ lorimoon hello, connect to the database I know can be connected directly, but I don't know use ADO.NET entity data model can connect?

CodePudding user response:

Using sqlsugar orm can easily reach the dream database source DEMO at https://github.com/sunkaixuan/SqlSugar

CodePudding user response:

A DmTest folder inside, as long as with good connection string manual build library, F5 to run automatically build table to run the DEMO,

Create the Db object
 
SqlSugarClient db=new SqlSugarClient (new ConnectionConfig ()
{
The ConnectionString=Server="XXXXX",//connector string
DbType=DbType. Dm,
IsAutoCloseConnection=true,
InitKeyType=InitKeyType. Attribute//read from the characteristics of the primary key information on the
});




Query
 

Var getAll=db. Queryable ToList () ();//query all
Var getFirst=db. Queryable (). The First (it=& gt; It. The Id=1);//query a single
Var getAllNoLock=db. Queryable (.) With (SqlWith. NoLock). ToList ();//is essentially the withnolock inside
Var getByPrimaryKey=db. Queryable (). InSingle (2);//query according to the primary key
Var sum=db. Queryable It=(). The Sum (& gt; It. Id);//query combined
Var isAny=db. Queryable () Where (it=& gt; It. The Id==1). Any ();//if there is a
Var isAny2=db. Queryable (a). Any (it=& gt; It. Id==1);
Var getListByRename=db. Queryable (). AS (" Student "). ToList ();
Var getByWhere=db. Queryable () Where (it=& gt; It. The Id==1 | | it. The Name=="a".) ToList ();
Var list=db. Queryable (). AS (" student2019 "). ToList ();//select * from student2019
Var list2=db. Queryable () Where (it=& gt; It. The Name. The Contains (" jack ")). ToList ();//fuzzy query name like '%' + @ name + '%'


  • Related