пʼятницю, 22 липня 2011 р.

Visual Studio: find invalid commas in *.js

Use find with regexp:

,[:b\n]*[\]\)\}]

середу, 13 липня 2011 р.

Oracle grant execute


grant execute on aspnetuser.goods_all_get_gtitle_by_gid to pds_sales;

Anonymous PL/SQL block


DECLARE
gid NUMBER(10):=5850802;
title varchar2(80);
BEGIN
IF gid is null THEN
DBMS_OUTPUT.PUT_LINE('GID is null');
ELSE
select t.g_name
into title
from typhoon.tbl_goods_all t
where t.g_id = gid;
DBMS_OUTPUT.PUT_LINE(title);
END IF;
END;

понеділок, 4 липня 2011 р.

C#, read data from Excel (*.xls) file


var file = Server.MapPath("file.xls");
var cs = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0;", file);

using(var conn = new OleDbConnection(cs))
{
using(var cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", conn))
{
using(var adapter = new OleDbDataAdapter(cmd))
{
var table = new DataTable();

adapter.Fill(table);

grid.DataSource = table;
grid.DataBind();
}
}
}

пʼятницю, 1 липня 2011 р.

Ext: confirm dialog localization


if (Ext.window.MessageBox) {
Ext.window.MessageBox.prototype.buttonText = {
ok: "OK",
cancel: "Отмена",
yes: "Да",
no: "Нет"
};
Ext.MessageBox = Ext.Msg = new Ext.window.MessageBox();
}