Skip to content

Instantly share code, notes, and snippets.

USE RedFoxAuto
DECLARE @PricelistID varchar(50), @lName varchar(50)
DECLARE cursorName CURSOR LOCAL SCROLL STATIC FOR
SELECT pricelistID, pricelistName FROM productPricelistNames
OPEN cursorName -- open the cursor
FETCH NEXT FROM cursorName INTO @PricelistID, @lName
WHILE @@FETCH_STATUS = 0
@arijusg
arijusg / gist:b54e22cf0689197dbe9e
Created June 23, 2014 13:42
DataTable convert into Csv and push to the browser
public class DataTableToCsv
{
public void Generate(DataTable dt, string fileName)
{
var sb = new StringBuilder();
IEnumerable<string> columnNames = dt.Columns.Cast<DataColumn>().
Select(column => column.ColumnName);
sb.AppendLine(string.Join(",", columnNames));
@arijusg
arijusg / Instructions
Created June 6, 2014 14:28
Control Windows services from an ASP.Net WebApp
Assuming your services are already installed...
First you will need SubInACL (SubInACL.exe)
SubInACL is a command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain.
http://www.microsoft.com/en-us/download/details.aspx?id=23510
Second you will need to run a batch or commands manualy to give Start/Stop rights ("T and O").
Third. Publish your app and test it.