Tuesday, August 25, 2009

How to modify the content of the existing DataTable in C#?

Let said the existing DataTable dt has some existing value in column "A" and "B" at first row (Rows[0])

so,

dt.Rows[0]["A"] = You new value here;
dt.Rows[0]["B"] = You new value here;

dt.Rows[0].AcceptChanges();
dtAcceptChanges();

Thursday, August 13, 2009

concatenation in SQL

DECLARE @myList varchar(1000)


select @myList = COALESCE(@myList + ', ', '') + cast(p.xxx_spec as varchar(50))

from tableX p

where p.xxID IN (123, 1234)


SELECT 'Return Value' = @myList