devart

Delphi: How to get the query that is passed to the server when parameters are used

∥☆過路亽.° 提交于 2019-12-19 03:37:19
问题 I have a query with parameters inside a Devart TMSQuery.SQL. Something like select * from customers where customer = :CustomerID in code I do // Delphi sqlcustomer.ParamByName('CustomerID').asinteger := 4; sqlcustomer.open; I want to debug and see the exact sql command sent to the server, if I try to use TMSQuery.sql I just have the :CustomerID, while I would like to have this: select * from customers where customer = 4 is there a quick way to have this without reading all the parameters and

CLOB vs. VARCHAR2 and are there other alternatives?

北城余情 提交于 2019-12-13 12:25:51
问题 I am using DevArt's dotConnect and Entity Developer for my application. I've created the tables using the Entity-First feature. I notice that many of the column types are set to CLOB. I only have experience with MySQL and Microsoft SQL server, so I am not sure about using CLOB for the application. I did some reading, and found out that CLOB are for large chunk of data. The questions are: Is using CLOB for most fields, such as the user's gender (which should be a varchar (1) ) or the full name

Devart ChangeConflictException but values still written to database

雨燕双飞 提交于 2019-12-12 03:36:23
问题 I have an intermittent Devart.Data.Linq.ChangeConflictException: Row not found or changed raising it's ugly head. The funny thing is, the change is still written to the database! The stack trace says: Devart.Data.Linq.ChangeConflictException: Row not found or changed. at Devart.Data.Linq.Engine.b4.a(IObjectEntry[] A_0, ConflictMode A_1, a A_2) at Devart.Data.Linq.Engine.b4.a(ConflictMode A_0) at Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) at Devart.Data.Linq

Represent View Without Key in Entity Framework

梦想与她 提交于 2019-12-11 16:28:00
问题 I'm using a model produced with Devart Entity Developer (.edml file, which I understand is mostly similar to .edmx) to generate Entity classes whose relations are initialized in a DbContext class. The database schema specifies no PK for View1, and all columns are nullable. But the code generation assumes that for views lacking a primary key, all columns are the key. I.e., the .ssdl has all columns under the Key element and the DbContext has .IsRequired() specified on all, like so: ssdl

*Not* getting ChangeConflictException using Devart

谁说胖子不能爱 提交于 2019-12-11 11:32:50
问题 I'm investigating an intermittent occurrence of Devart.Data.Linq.ChangeConflictException: Row not found or changed . I've been reading the Devart article on concurrency conflicts, and just as a starting point I am trying to reproduce a concurrency conflict. Using the included MS-based LINQ classes this is easy to do (using the code structure below does so successfully). However even following their example in the article I can't produce an exception. I have tried Using both an ADO

Coverting a TMyQuery dataset to TClientDataSet in Delphi

泄露秘密 提交于 2019-12-11 00:42:52
问题 I make use of the Mydac components by devart (corelab) to access MySql from Delphi (2006) Very often I need to work with data in a TClientDataSet What is the best way to convert the dataset of a TMyQuery to TClientDataSet Currently I am using var MyQuery : TMyQuery; Dsp : TDataSetProvider; Cds : TClientDataSet; begin MyQuery := nil; Dsp := nil; Cds := nil; try MyQuery := TMyQuery.Create(nil); Dsp := TDataSetProvider.Create(nil); Cds := TClientDataSet.Create(nil); MyQuery.Connection :=

Some tricky quick way to validate oracle db connection

旧街凉风 提交于 2019-12-08 03:41:38
问题 My WCF service need to check is connection available now and can we work with it. We have many remote dbs. Their connection are weird sometimes and can't be used to query data or smth else. So, for example this is regular connection string used: User Id=user;Password=P@ssw0rd;Data Source=NVDB1;Connection Timeout=30 Here is service method, used for getting public List<string> GetAliveDBs(string city) { if (String.IsNullOrEmpty(city)) return null; List<string> cityDbs = (from l in alldbs where

CLOB vs. VARCHAR2 and are there other alternatives?

你离开我真会死。 提交于 2019-12-05 00:52:36
I am using DevArt's dotConnect and Entity Developer for my application. I've created the tables using the Entity-First feature. I notice that many of the column types are set to CLOB. I only have experience with MySQL and Microsoft SQL server, so I am not sure about using CLOB for the application. I did some reading, and found out that CLOB are for large chunk of data. The questions are: Is using CLOB for most fields, such as the user's gender (which should be a varchar (1) ) or the full name, feasible? The steps for converting a CLOB field to VARCHAR2 requires dropping the column then re

Can we control LINQ expression order with Skip(), Take() and OrderBy()

倾然丶 夕夏残阳落幕 提交于 2019-12-03 06:23:11
I'm using LINQ to Entities to display paged results. But I'm having issues with the combination of Skip() , Take() and OrderBy() calls. Everything works fine, except that OrderBy() is assigned too late. It's executed after result set has been cut down by Skip() and Take() . So each page of results has items in order. But ordering is done on a page handful of data instead of ordering of the whole set and then limiting those records with Skip() and Take() . How do I set precedence with these statements? My example (simplified) var query = ctx.EntitySet.Where(/* filter */).OrderByDescending(e =>

How can I use LinqPad's generated context in Visual Studio

折月煮酒 提交于 2019-11-30 22:05:53
This is a follow-on from this question really: Moving From LINQpad to a Proper Visual Studio Project? ..but I'm not able to get it to work properly. An answer to that question suggestions dumping the context assembly out as a dll but although I have done that, when I import it as a reference, it's not exactly clear to me how I would create an instance of that context, point it at a database and actually run a query against it, something like the following: var db = new ContextFromThatDLL(myconnectionstring); var query = from a in db.MYTABLE where a.ID == 1 select a; Extra information: I am