Search This Blog

Monday, November 4, 2013

Reflection C#

C# > Reflection 

Reflection offers the possibility   to describe assemblies, modules and types. It enables you to access the attributes. 
A compiled C# program is a relational database called metadata.


Example:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace csharp
{
    public partial class Form1 : Form
    {
        public static int mNumber = 10;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Type objType = typeof(Form1);
            FieldInfo field = objType.GetField("mNumber");
            object objValue = field.GetValue(null);
            MessageBox.Show(objValue.ToString());
        }
    }
}




Friday, November 1, 2013

Linked Server (SQL Server)

SQL Server > Linked Server

linked server allows the SQL Server Database Engine to execute commands against OLE DB data sources.
Linked servers are configured to enable the Database Engine to execute a Transact-SQL statement to another instance of SQL Server or another database such as Oracle.
OLE DB data sources can be configured as linked servers like Microsoft Access and Excel.

Advantages:
  • access data from outside of SQL Server.
  • execute distributed commands( queries updates, transaction) to  heterogeneous data sources

Examples:

Add Microsoft Access as linked server

    Microsoft SQL Server

    Microsoft SQL Server is a relational database management system developed by Microsoft.
    SQL Server supports ANSI SQL, the standard SQL language like all major RBDMS.
    SQL Server contains own SQL implementation named T-SQL.
    SQL Server Management Studio (SSMS) is SQL Server interface tool.




    SQL Server script return the last stored procedures modified in the last n days

    SQL Server > sys.objects > Last modified stored procedures

    Example

    declare @nmb_days int = 10
    SELECT * FROM sys.objects 
    WHERE TYPE = 'P' 
    AND DATEDIFF(D,modify_date, GETDATE()) < @nmb_days




    RadGridView for WinForms

    Telerik > RadGridView

    RadGridView Telerik  for Windows forms is a complex control that allows to display and edit tabular data from different  data sources.







      RadControls for WinForms

      Telerik > RadControls for WinForms

      Telerik RadControls for WinForms includes more than 60 controls that you can use to easily build visually appealing, high performance Line of Business and Metro applications.

      http://www.telerik.com/products/winforms.aspx

      Telerik

      Telerik is a software company making of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Automated Testing, Team Productivity and Run-time Analytics Tools.

      Reporting

      Windows Forms
      ASP.NET