This is the best/most robust auto suggest plugin for jQuery I've found. Props, Mr. Wilson! Thanks for this!
Wednesday, May 25, 2011
Tuesday, May 24, 2011
IEnumerable of Anonymous types ..
Here's how you create an IEnumerable of an Anonymous type. This is very useful for talking to JSON
// create anonymous type
var reportExample = new { ReportName = "", ReportID = 0};
// create IEnumerable of anon type
var listExample = (new[] { reportExample }).ToList();
var theList = JsonConvert.DeserializeAnonymousType(hdnSelectedReportIds.Value, listExample);
// create anonymous type
var reportExample = new { ReportName = "", ReportID = 0};
// create IEnumerable of anon type
var listExample = (new[] { reportExample }).ToList();
var theList = JsonConvert.DeserializeAnonymousType(hdnSelectedReportIds.Value, listExample);
Monday, May 23, 2011
Wednesday, May 18, 2011
http://gotiggr.com for web prototyping is ffin awsom
http://gotiggr.com for web prototyping is effin' awesome
Monday, May 16, 2011
Reading / Writing Excel from SQL Server
sample code from a buddy of mine at work -- this is pretty cool and will definitely come in useful at some point.
/*
Online info:
http://serendipitous-stuff.blogspot.com/2010/07/import-excel-xlsx-into-64-bit-sql.html
Online info:
http://serendipitous-stuff.blogspot.com/2010/07/import-excel-xlsx-into-64-bit-sql.html
64-bit drivers:
http://www.microsoft.com/downloads/en/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en
http://www.microsoft.com/downloads/en/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en
*/
-- Required configuration steps:
sp_configure 'show advanced options', 1 -- EQ's ntsql1dev was already 1.
reconfigure
go
sp_configure 'Ad Hoc Distributed Queries', 1 -- EQ's ntsql1dev was 0.
reconfigure
go
-- sp_configure 'show advanced options', 0 -- Skipped this.
-- reconfigure
go
USE [master]
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess' , 1
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO
sp_configure 'show advanced options', 1 -- EQ's ntsql1dev was already 1.
reconfigure
go
sp_configure 'Ad Hoc Distributed Queries', 1 -- EQ's ntsql1dev was 0.
reconfigure
go
-- sp_configure 'show advanced options', 0 -- Skipped this.
-- reconfigure
go
USE [master]
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess' , 1
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO
USE PLT_AI
-- Samples from online somewhere
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Text;Database=F:\scripts\;HDR=Yes;', 'SELECT * FROM Company.xls')
SELECT company_id, company_name, address_1, address_2, address_3, phone, epa_id, phone_customer_service FROM Company
-- Fail. Seems the openrowset args are bad here.
-- Another sample... test Reading:
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=NO;Database=F:\Scripts\Company.xls','SELECT * FROM [Sheet1$]')
-- Works!!
-- Test Writing that way:
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=NO;Database=F:\Scripts\Company.xls','SELECT * FROM [Sheet1$]')
SELECT company_id, company_name, address_1, address_2, address_3, phone, epa_id, phone_customer_service FROM plt_ai..Company
-- No errors!!
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=NO;Database=F:\Scripts\Company.xls','SELECT * FROM [Sheet1$]')
SELECT company_id, company_name, address_1, address_2, address_3, phone, epa_id, phone_customer_service FROM plt_ai..Company
-- No errors!!
-- Re-read it:
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=NO;Database=F:\Scripts\Company.xls','SELECT * FROM [Sheet1$]')
-- WWOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;HDR=NO;Database=F:\Scripts\Company.xls','SELECT * FROM [Sheet1$]')
-- WWOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!
Friday, May 6, 2011
Thursday, May 5, 2011
Tuesday, May 3, 2011
Troy Hunt: The 10 commandments of good source control management
http://www.troyhunt.com/2011/05/10-commandments-of-good-source-control.html
Monday, May 2, 2011
Subscribe to:
Posts (Atom)