These are very simple samples. I will complete it in next weeks.

SELECT * FROM EasyLibrary.Item
QSelect select1=new QSelect(new QTable("EasyLibrary.Item"));

SELECT Id FROM EasyLibrar.Item
QSelect select2=new QSelect(new QTable("EasyLibrary.Item"),new QColumn("Id"));
List<QElement> rows=select2.ExecuteReader(_sqlConnection)

SELECT Id as ItemId FROM EasyLibrar.Item
QSelect select3=new QSelect(new QTable("EasyLibrary.Item"),new QColumn("Id","ItemId"));

SELECT Id as ItemId FROM EasyLibrar.Item AS ItemTable
QSelect select4=new QSelect(new QTable("EasyLibrary.Item","ItemTable"),new QColumn("Id","ItemId"));
or
QSelect select4=new QSelect();
select4.Add(new QTable("EasyLibrary.Item","ItemTable"));
select4.Add(new QColumn("Id","ItemId"));

SELECT * FROM EasyLibrary.Item AS T1 INNER JOIN EasyLibrary.SystemType AS T2 ON T2.Id=T1.Id
QSelect select5=new QSelect(new QTable("EasyLibrary.Item","T1"),
new QInnerJoin(new QTable("EasyLibrary.SystemType","T2"),new QCriteria("T2.Id=T1.Id"));

SELECT * FROM EasyLibrary.Item AS T1 INNER JOIN EasyLibrary.SystemType AS T2 ON T2.Id=T1.Id WHERE T1.Id=@ItemId
QSelect select6=new QSelect(new QTable("EasyLibrary.Item","T1"),
new QInnerJoin(new QTable("EasyLibrary.SystemType","T2"),new QCriteria("T2.Id=T1.Id"));
select6.Add(new QWhere(new QCriteriaEqual("T1.Id",new QParameter("@ItemId",Guid.Empty))));

SELECT * FROM EasyLibrary.Item
SELECT * FROM EasyLibrary.Item AS T1 INNER JOIN EasyLibrary.SystemType AS T2 ON T2.Id=T1.Id
SELECT * FROM EasyLibrary.Item AS T1 INNER JOIN EasyLibrary.SystemType AS T2 ON T2.Id=T1.Id WHERE T1.Id=@ItemId

Query query=new Query(select1,select5,select6);

More examples of QSelect, QInsert, QUpdate and QDelete are coming soon :)

Last edited May 26, 2010 at 11:33 AM by devKing, version 5

Comments

No comments yet.