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

Convert To Dictionary

Posted by: RcBuilder  /   Category: Dictionary / Generic T / Lambda / Linq / List / SOURCE CODE   /   No Comments
05
Oct
2014

Convert To Dictionary using System; using System.Collections.Generic; using System.Linq; class ConvertToDictionary { private List<string> values = new List<string>() { "ROBY", "AVI", "ISSAC", "YOSSI", "IDAN", "SHARON" }; public void ConvertAnonymous() { var res = from item in values select new { MyName = item, item.Length }; Dictionary<string, int> dic = res.ToDictionary(k => k.MyName, k => k.Length); foreach (var keypair in dic) Console.WriteLine(keypair.Key + " = " + keypair.Value); } public.

Read more

List 2 String using Join T

Posted by: RcBuilder  /   Category: Generic T / List / SOURCE CODE   /   1 Comment
24
Jun
2014

List 2 String using Join T structure string.Join<T>(string Delimiter, List<T> list); string str = string.Join<string>(";", MyList); example public void Fun1(string Login) { Fun1(new List<string>(){ Login }); } public void Fun1(List<string> Logins) { string sLogins = string.Join<string>(";",.

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