Feeds:
Posts
Comments

Archive for May, 2009

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]

Advertisements

Read Full Post »

update daily_sales
set is_calc='Y'
from daily_sales
inner join (select top 100 * from daily_sales where product_category='CA') a
on a.unique_record_id=daily_sales.unique_record_id
and a.milestone_code=daily_sales.milestone_code

Source is SQLServerCentral

Read Full Post »

%d bloggers like this: