This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @tableName varchar(200) | |
declare @columnName varchar(200) | |
declare @nullable varchar(50) | |
declare @datatype varchar(50) | |
declare @maxlen int | |
declare @sType varchar(50) | |
declare @sProperty varchar(200) | |
DECLARE table_cursor CURSOR FOR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void BulkInsert<T>(string connection, string tableName, IList<T> list) | |
{ | |
using (var bulkCopy = new SqlBulkCopy(connection)) | |
{ | |
bulkCopy.BatchSize = list.Count; | |
bulkCopy.DestinationTableName = tableName; | |
var table = new DataTable(); | |
var props = TypeDescriptor.GetProperties(typeof(T)) | |
//Dirty hack to make sure we only have system data types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace SLaks.Web.Mvc { | |
//http://blog.slaks.net/2011/09/using-default-controller-in-aspnet-mvc.html |