Telerik blogs
  • Productivity

    Migrating data from one database server to another

    In today’s post we are going to discuss a topic which is known to be fairly complex in most cases but it is relevantly easy to be achieved with Telerik OpenAccess ORM. Let us consider the following scenario: your company decides to move your data access from one database server to another.  So you have your database in a MSSQL Server instance  and want to migrate to MySql. The schema is the same on both servers but the data resides inside  the MSSQL Server instance. What follows is the easiest way to move all the data from the MSSQL server database to...
    May 27, 2021 2 min read
  • Web

    Binding Hierarchical RadGrid with Telerik OpenAccess ORM

    It is quite often that different customers eventually face the need to use a master-detail hierarchical representation of their data. However most customers are not aware that this is extremely easily achievable using Telerik OpenAccess ORM together with our RadGrid. Furthermore it is achieved without writing ANY code in the code behind file of your project. Now let’s get to the job! What will be needed is just one RadGrid and two OpenAccessDataSource controls. The two data source controls will be used to query data from the master and detail tables. In our case we used the Company and Employee tables(one company has many...
    May 27, 2021 3 min read
  • Productivity

    Altering OQL queries to generate different JOIN clauses in SQL

    As most of you probably know, OQL was the main object-oriented query language that was supported by Telerik OpenAcess ORM before Linq was introduced in .NET. Even though Linq is now the de facto standard for querying data, support for OQL is still there and I would state that it still is pretty convenient to use in some scenarios. We will use this post to share some tips on querying data using the Object Query Language. Consider the following query: IQueryResult projection = scope.GetOqlQuery("SELECT pr.ProductName, cat.CategoryName " + "FROM CategoryExtent AS cat,cat.Products AS pr").Execute();  This query makes...
    May 27, 2021 2 min read
  • Productivity

    LINQ Tip of the week: System.DateTime support

    Continuing with the LINQ tips, today we provide a list of System.DateTime properties and methods that are supported by the Telerik OpenAccess ORM LINQ implementation. The table below provides the equivalent SQL function call for every member.   Please note that the table lists the MS SqlServer specific SQL translation.   Properties DateTime.Day DAY(date) DateTime.Hour DATEPART(hour, date) DateTime.Millisecond DATEPART(millisecond,date) DateTime.Minute DATEPART(minute, date) DateTime.Month MONTH(date) DateTime.Second DATEPART(second, date) DateTime.Year YEAR(date)   Static Methods DateTime.Parse(String) value is parsed on the client side and the result is pushed to the server as filter DateTime.Parse(String,IFormatProvider) value is parsed on the client side and the result is pushed to the server as filter DateTime.Parse(String,IFormatProvider,DateTimeStyles) value is parsed on the client side and the result is pushed to the server as filter   The various comparison operators...
    May 27, 2021 1 min read
  • Productivity

    Customizing the behavior of persistent collections

    As most of you may already know, Telerik OpenAccessORM uses the TrackedList<T> to manage the collection fields of its persistent classes. The objects that belong to such collection are in a 1-n relation with the parent object that ‘owns’ the collection. Before getting to the point of this post, let me put few words about the behavior of the TrackedList<T>. When a new object is added to a TrackedList<T>(ex: order.OrderDetails.Add(someDetail) ),Telerik OpenAccess ORM persists that object to the database. The new object has a reference to the owner of the collection to which it was added.  When one removes an object from...
    May 27, 2021 2 min read