Tag Archives: .net

PHP / RegEx – Convert URLs to links by detecting .com/.net/.org/.edu etc

Questions: I know there have been many questions asking for help converting URLs to clickable links in strings, but I haven’t found quite what I’m looking for. I want to be able to match any of the following examples and turn them into clickable links: http://www.domain.com https://www.domain.net http://subdomain.domain.org www.domain.com/folder subdomain.domain.net subdomain.domain.edu/folder/subfolder domain.net domain.com/folder I do… Read More »

.NET & ASP vs PHP [closed]

Questions: Earlier today I asked wether it would be a good idea to develop websites using C#. Most of the answers pointed towards .NET and ASP. Currently I develop with PHP. I’ve dabbled with Python and RoR but I always come back to PHP. This is the first time I’ve looked at .NET and ASP.… Read More »

ASP.NET Excel file download on button click

Questions: To preface, all of this occurs on a local intranet, which does not at any point need to connect to the internet. I have a database on which I run a query, after which the user presses a “Download Spreadsheet” button which creates/sends the spreadsheet. The creation of the spreadsheet works fine, but after… Read More »

Issue with using Office Interop with Excel and .NET 4.0/4.5

Questions: I have the following bit of code that works fine when I target .NET 3.5: Microsoft.Office.Interop.Excel.Application _excelInstance; Microsoft.Office.Interop.Excel.Worksheet _excelWorksheet; Microsoft.Office.Interop.Excel.Workbook _excelWorkbook; _excelInstance = new Microsoft.Office.Interop.Excel.Application(); _excelWorkbook = _excelInstance.Workbooks.Add(); _excelWorksheet = (Microsoft.Office.Interop.Excel.Worksheet)_excelWorkbook.Worksheets.get_Item(1); However, when I target .NET 4.5, the compiler gives the following error for the last line above: One or more types required to… Read More »

Fail to open excel file using Process.Start() in .Net4.0

Questions: Recently an old project of .Net 1.1 is migrating to .Net4.0. The project is using the following method to open excel file: Process process = new Process(); try { process.StartInfo.FileName = marco_file; process.Start(); } catch(Exception) { } finally { process.Close(); } And the marco_file is the path of excel file with macros, like “C:\project\test.xls”… Read More »

Efficiently generate a very large Excel file in .NET?

Questions: I need to generate a very large Excel file from an ASP.NET MVC site, but am running into memory limitations using the Open XML SDK. Is there a memory efficient way to generate such a file? For reference, I’m trying to generate a spreadsheet with about 500,000 rows with 20 columns each. The data… Read More »