Feeds:
Posts
Comments

Posts Tagged ‘.Net’

List<Nullable<int>> custIDs = (from l in lookUpList 
                               group l by l.CustID into g
                               select g.Key).ToList<Nullable<int>>();
var customers=from c in new Repository().GetCustomers()
              where custIDs.Contains(c.CustID)
              select c).ToList();
Advertisements

Read Full Post »

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class FormStringSpliter : Form
{
public FormStringSpliter()
{
InitializeComponent();
LoadText();
}

private void LoadText()
{
textBox1.Text = @”2008,65765,””Tan Kok Ying , Blue””,K,Jalan Ramlee”;
List t= SplitText(textBox1.Text);
string te = “”;
for (int i = 0; i < t.Count; i++) te = te + t[i].ToString() + "\t"; string[] copyArray = t.ToArray(); textBox2.Text = te; } private List SplitText(string source)
{
List splittedText = new List();
char[] sp = {‘,’};
string[] strArray = source.Split(sp);

for (int i = 0; i < strArray.Length; i++) { if (strArray[i].Contains(@"""")) { splittedText.Add(strArray[i].ToString() + strArray[i+1].ToString()); i++; } else splittedText.Add(strArray[i].ToString()); } return splittedText; } } } [/sourcecode]

Read Full Post »

%d bloggers like this: