if (e.Row.RowType == DataControlRowType.DataRow) { DataRow row = ((DataRowView)e.Row.DataItem).Row; for (int i = 0; i < row.ItemArray.Length; i++) { var obj = row.ItemArray[i]; if (obj.GetType().Name == "DateTime") { e.Row.Cells[i + 1].Text = ((DateTime)obj).ToShortDateString(); } else if (obj.GetType().Name == "Boolean") { e.Row.Cells[i + 1].Text = ((Boolean)obj).ToYesNo(); } } }
world wide web development problems asp net php html xhtml css javascript jquery w3dproblems
Monday, February 29, 2016
How to change a value of a DataItem in a GridViews RowDataBound Event
jQuery: get the file name selected from
$('input[type=file]')[0].files[0].name;
$("input[type=file]")[0].files[0].type;
$("input[type=file]")[0].files[0].size;
$("input[type=file]")[0].files[0].type;
$("input[type=file]")[0].files[0].size;
Wednesday, February 24, 2016
How do you check if a certain index exists in a sql server table?
IF EXISTS(SELECT * FROM sys.indexes WHERE name='[IndexName]' AND object_id = OBJECT_ID('[Schema].[Table]')) BEGIN --statements END
Tuesday, February 23, 2016
SET ENABLE SQL Server Broker taking too long time
ALTER DATABASE <db_name>
SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE
Sunday, February 21, 2016
How to disable all triggers MS SQL Server
To disable all trigger
Or to enable or triggers
sp_msforeachtable 'ALTER TABLE ? DISABLE TRIGGER all'
Or to enable or triggers
sp_msforeachtable 'ALTER TABLE ? ENABLE TRIGGER all'
Enable / Disable trigger in MS SQL server
DISABLE
ALTER TABLE table_name DISABLE TRIGGER tr_name
ENABLEALTER TABLE table_name ENABLE TRIGGER tr_name
SQL Server: Database stuck in “Restoring” state
RESTORE DATABASE MyDatabase
FROM DISK = 'MyDatabase.bak'
WITH REPLACE,RECOVERY
FROM DISK = 'MyDatabase.bak'
WITH REPLACE,RECOVERY
Subscribe to:
Comments (Atom)