RcBuilder@walla.com
call centre: 054-5614020

custom DataTable

Posted by: RcBuilder  /   Category: abstract / ADO.NET / DataColumn / DataRow / DataTable / DefaultView / Entities / Generic T / inheritance / OOP / SOURCE CODE   /   No Comments
11
Jan
2015

custom DataTable namespace CSCode.DataTables { public abstract class baseDataTable { protected DataTable dataTable; public int RowsCount { get { return this.dataTable.Rows.Count; } } public void Sort(string SortColumn) { var view = this.dataTable.DefaultView; view.Sort = SortColumn; this.dataTable = view.ToTable(); } public void ReplaceString(string ColumnName, string OldValue, string NewValue) { foreach (DataRow row in this.dataTable.Rows) try { row.SetField<string>(ColumnName, row.ToString().Replace(OldValue, NewValue)); } catch { } } public object GetSpecificValue(int RowIndex, string ColumnName) { return this.dataTable.Rows; } public static explicit operator DataTable(baseDataTable me) { return me.dataTable; } public static.

Read more

LINQ 2 SQL

Posted by: RcBuilder  /   Category: ADO.NET / button / Button / DBA / div / GridView / HTML / LINQ 2 SQL / SOURCE CODE / SQL   /   No Comments
09
Nov
2014

LINQ 2 SQL STEPS 1. add new Item -> Linq To SQL Classes (.dbml) 2. open server explorer -> create new connection to the desired dataBase 3. drag-drop the tables you want to map to objects remark: you can also drag stored Procedures, views and more ... 4. add -> associations (create the connections between the tables - foreign keys) 5. use.

Read more

Entity Framework DataBase First

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework / SQL   /   No Comments
31
Oct
2014

Entity Framework DataBase First Create Entity Data Model * Add -> New Item -> (Data Tab) ADO.NET Entity Data Model (.edmx) -> set mame -> ok * in the wizard -> choose 'Generate from database' option * choose the connection string (web.config) or set a new one -> set the connection name -> next * choose the tables, views and.

Read more

Entity Framework Model First

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework / SQL / Stored Procedure   /   No Comments
30
Oct
2014

Entity Framework Model First Create model * Add -> New Item -> (Data Tab) ADO.NET Entity Data Model (.edmx) -> set mame -> ok * in the wizard -> choose 'Empty Model' option * by right clicking within the edmx area we can choose which elements to add to our model - Entity : add a new POCO object (Book,.

Read more

Entity Framework Code First

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework   /   No Comments
30
Oct
2014

Entity Framework Code First Create model * create entities within the code (users, products etc.) * create a new class inherit from DbContext (serve as our database connector) * set the connection string in the app.config   notice! the name MUST be identical to our database connector name! (default mode) * add the created objects from the first chapter as DbSet.

Read more

Entity Framework Data Annotations

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework / SQL / SQL Data Types   /   No Comments
30
Oct
2014

Entity Framework Data Annotations * Data Annotations are attributes that specify the following: 1. a validation rules 2. how the data is presented 3. how the data will be mapped to the database * add the following namespaces: - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; * we can combine multi annotations within the same brackets e.g: * - schema attribute - set the property as PK.

Read more

Entity Framework Migrations

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework / SQL   /   No Comments
30
Oct
2014

Entity Framework Migrations Manual Migrations * usually works alongside the 'Code First' approach * Migrations are updates package for model structure changes (classes), we can see information about all the changes performed in each migration and we can roll back to a specific migration * open the Package Manager (PM) console - Tools -> Library Package Manager -> Package Manager Console * enable.

Read more

Entity Framework BUGS

Posted by: RcBuilder  /   Category: ADO.NET / BUGS / Entity Framework   /   No Comments
30
Oct
2014

Entity Framework BUGS - issue - when using the code first approach we've got the following message "The type xxxxx was not mapped" - fix - change the object hierarchy. don't set the objects to map within another class (they should be directly under a namespace and not cascading under another class) - issue - while generating the edmx file we've got the.

Read more

Entity Framework Advantages & DisAdvantages

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework   /   No Comments
28
Oct
2014

Entity Framework Advantages & DisAdvantages * EF saves a lot of time of the object mapping, the writing of the stored Procedures, views, functions and more ... * EF is more convenient for the developers and easier to work with * EF mapped automatically therefore, any structured radical change can be implemented faster than searching all the Stored.

Read more

Entity Framework – APPROACHES

Posted by: RcBuilder  /   Category: ADO.NET / Entity Framework   /   No Comments
28
Oct
2014

Entity Framework - APPROACHES there are 3 approaches to use EF 1.DataBase First mapping an existing data base into code model 2.Code First create a new data base based on created code objects 3.Model First create an empty model we can later on generate a database based on it. in this approach we'll do most of our definitions using the designer instead.

Read more
12
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים