background preloader

ASP.NET

Facebook Twitter

Witter / ? Learn ASP.NET, ASP.NET with C#, c-sharp ASP.NET development. Blogs. This post is a continuation of the Evolving ASP.NET series: Evolving ASP.NET Apps - Introduction Evolving ASP.NET Apps – Evaluating the Code Evolving ASP.NET Apps – Moving to a Web Application Evolving ASP.NET Apps – Dealing with Dependencies Evolving ASP.NET Apps – Updating Search Evolving ASP.NET Apps – Updating jQuery In this post, we will update the libraries used to retrieve and parse email from a Pop3 server.

Blogs

SharpMimeTools and Pop3 SharpMimeTools is an open-source MIME parser / decoder. Free ASP.NET Training Videos from aspConf now available for download or streaming. Top 10 Visual Studio 2013 Features for ASP.NET Developers. SQL Server: T-SQL to Show Table Column Information. Sometimes using the SSMS GUI table designer is a hassle when compared with directly querying the table structure using a simple SQL statement.

SQL Server: T-SQL to Show Table Column Information

For example if you are right in the middle of editing a stored procedure and want to know the data types and sizes of some columns for a table or two, then rather than navigating away from your procedure, you can do a lookup within the code itself. This saves you a lot of tabbing between windows since the table information is right where you need it; where you are writing your code. 1) Query the SQL Server information schema views: USE MyDataBase GO SELECT TABLE_NAME ,ORDINAL_POSITION ,COLUMN_NAME ,DATA_TYPE ,CHARACTER_MAXIMUM_LENGTH ,IS_NULLABLE ,COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME IN ('MyTableName','MySecondTable') ORDER BY TABLE_NAME,COLUMN_NAME ASC 2) Query the System objects/Columns/Types Tables Both of these methods work very nicely in SQL Server 2005 and SQL Server 2008.

Like this: Like Loading... Galaxy S2 Boot Issues – How to Force your Phone to Start. Today I encountered boot issues with a Samsung Galaxy S2 device.

Galaxy S2 Boot Issues – How to Force your Phone to Start

The phone has never experienced problems of this sort in the past so its refusal to start today was a surprise. Before I go into details about how I fixed things, I’ll give some background information on what happened. Background symptoms. Generate a PDF from an ASP.NET Web Page using the iTextSharp XMLWorker Namespace. If you need to quickly and easily generate PDF documents from ASP.NET, then the iTextSharp library for .NET is very convenient.

Generate a PDF from an ASP.NET Web Page using the iTextSharp XMLWorker Namespace

To install and start using iTextSharp, you can download the zipped reference files from the SourceForge Web site and then add them to your Visual Studio project the same way as you would do with any other third party library file. The latest version of iTextSharp has deprecated the older HTMLWorker object in favor of the newer XMLWorkerHelper object. This is good news for any developer who likes to use CSS formatting. Although the CSS support is still basic, it is a definite step up from the earlier version of the object which did not support CSS at all. For example, the new object allows a number of important behaviors such as PDF page breaks that were impossible to do using the older object.

To make use of the XMLWorkerHelper object you will need to reference two DLL files in your Visual Studio project. Set up a Multi-Line Editable GridView Disassociated from a DataSource. Multi-Line Editable Gridview Control GridView controls are versatile multi-purpose ASP.NET widgets. I like the default functionality when hooked up to a data source, but depending on a project’s requirements I also like the ability to tweak the default functionality to make the GridView behave in different ways. For example, in past projects users have asked me to create a more Excel-like interface for viewing and managing their data. This is certainly possible with a GridView control. To take things one step further, in some cases the GridView can even be used as a UI-specific widget that runs disassociated from a DataSource.

The ASP.NET Dictionary Object. I have been working with ASP.NET collections and thought a more detailed look into one of the most useful classes also know as the Dictionary collection object is in order.

The ASP.NET Dictionary Object

To review: the Dictionary class is part of the System.Collections.Generic Namespace. If you haven’t already, then it’s worth having a look at the list of collections contained in the namespace to become familiar with the various collections options available to you. The main benefit of the using collections from the Generic namespace is that the collections are strongly typed, giving you better performance and type safety.

InvalidCastException – Failed to convert parameter value from a XmlDocument to a String. Quick and Easy Windows Shortcuts to Common Server Applications. The other day I was working on a Windows 2003 SP2 server that was no longer displaying anything other than the Windows desktop.

Quick and Easy Windows Shortcuts to Common Server Applications

I could not bring up the start menu or even see the bottom menu bar. This naturally was a problem because I wanted to set up a new Web site on the server. In my experience this problem with Windows is most likely caused by Windows running for too long without a restart, so the standard fix is typically to restart the entire computer. However, restarting the server was not an option since at that time it was being actively used by other developers for development and testing. Web App Dev. ASP.NET Overview of Binding a DropDownList to a FormView. If you use (or want to use) .NET WebForms databinding then you know that dropdown lists can be tricky to populate and mange.

ASP.NET Overview of Binding a DropDownList to a FormView

For example, say you have a FormView control with an embedded DropDownList control that you want to bind and pre-select when someone views the form. It’s not immediately intuitive how to do so, but it’s really quite straightforward. Here’s how: First, drag the FormView control onto your WebForm and then add a DropDownList control.Then drag two DataSource controls onto your WebForm and assign one to your FormView control and the other to your DropDownList control along with SQL queries to populate both.Set the DataTextField and DataValueField parameters for your DropDownList.

The DataValueField parameter is what gets passed to your form and back to the database behind the scenes, while the DataTextField parameter is what is displayed to users of your form in the DropDownList control’s options. Here’s an example of what your DropDownList control should look like: VS2010 Outlook ThisAddIn – How to Get the Sent Email Message. When writing an email add-in for Outlook with Visual Studio, it’s really quite easy to get the email message object while the send event is in progress using the Application.ItemSend event.

VS2010 Outlook ThisAddIn – How to Get the Sent Email Message

However this event happens before the email is sent, so although it can be useful, the Application.ItemSend event is often not the correct event handler to be used when working with Outlook email messages programmatically. VS2010 Custom Outlook Folder View Including UDFs (User Defined Fields) If you are building an Outlook Add-In application with Visual Studio, it’s likely that at some point you will want programmatic control over the information that Outlook shows in a specific email folder.

VS2010 Custom Outlook Folder View Including UDFs (User Defined Fields)

For instance, let’s say that you have code that automatically backs up sent emails to a custom folder hierarchy. So if the email you sent includes sample code, then the email should be automatically backed up into a custom sub-folder called “Sample Code” that exists within your custom “Programming” folder within your Outlook mailbox. If that sounded confusing, here’s an image of what I’m talking about: +Mailbox |_Programming |_Notes |_Sample_Code |_General |_Sent Items |_Etc... How to Extend the Expanded Select List Options for Older Browsers. Example of a Lengthening Select List When putting together a Web based form space can be at a premium.

How to Extend the Expanded Select List Options for Older Browsers

Select lists are typically auto-adjusted by your browser to be the length of the longest option in the list. But that just doesn’t work when space is tight and in many of my forms one doesn’t want the select list to automatically size itself to a length beyond what has been allocated for it, especially if the options are dynamically coming from a database. Use RAD with Visual Studio WebForms to Programmatically Query a SQLDataSource Control from Custom Code. Rapid Application Development (RAD) offers huge advantages to developers under time constraints looking to get an application released as quickly as possible. Visual Studio 2010′s WebForms is a great environment to use when looking at possible RAD solutions. In this article I will cover the issue of using RAD with custom code to speed up writing database connections and queries. This is part of my series of articles investigating ASP.NET and Visual Studio 2010. Why is RAD so useful with Custom Code? Developers often end up hand-coding every step of a database connection, which includes processing the results and populating whatever widget they are working with.

Outlook Email Searches Broken by Indexing. Against any sort of logic, running email searches in Outlook on one of my development machines no longer returns any results for even the simplest searches. I am running Windows 7 and Office 2007 on my development machine. On another, older development machine I am running Windows XP with Office 2007. Now the strange thing is the inconsistency in how both versions of Office run. I’m not sure if it is the OS or some other factor, but the completely mystifying problem of Outlook on my Windows 7 machine not searching emails correctly appeared that I could not duplicate on my XP machine.

To recap – when I would try to run a either an advanced or an instant search on my Windows 7 Outlook it would not return any results no matter how much I tried. For example, I would be staring at an email in my Inbox with the word ‘test’ as a subject. I was pretty stumped and trying to duplicate this on my other machine was impossible because the identical search works just fine there. VSTO for MS Outlook 2007 – Using msocontroledit and msoControlComboBox in the Commandbars. Outlook Custom Search Fields VSTO for MS Outlook can be a powerful way to customize Outlook programmatically. However, the syntax can be finicky at times and I have found a few instances where the programming logic becomes tricky. McAffee ePO Conflicts with IIS (and how to Resolve the Conflict) It appears that McAfee’s ePO system causes conflicts with Web servers when it is hosted on the same machine as for example a Web server like IIS.

Why is this? I experienced this conflict on a Windows Server 2008 R2 server that was set up with IIS 7 and McAfee’s ePO system. Apparently McAfee’s ePO system runs on Apache behind the scenes and requires port 443 to be available. This causes a conflict with Web servers such as IIS which also need port 443, so either one or the other breaks if they are both up and running on the same server.

IIS6 – Change the ASP.NET Version Without Restarting the W3SVC Service Using Aspnet_regiis.exe. Classic ASP – Example of a Basic Database Connection (SQLOLEDB) Enable/Disable Allowed File Types in DotNetNuke. DotNetNuke File Type Error DotNetNuke (DNN) is a good content management system that greatly simplifies the day to day administration and content management of sites. Using a JQuery AutoComplete Widget with an ASP.NET Web Service.

Points to keep in mind when working with the iTextSharp HTML to PDF converter (HTMLWorker) Correcting 404 Errors in IIS 6 When Running an ASP.NET ASPX Page. Custom Function to Inject HTML Tags Iteratively into ListView Column Text. The ASP.NET system libraries offer powerful string manipulation functionality in the form of extensive Regular Expression support as well as String-specific functions such as Split and Replace. In 99% of cases these functions are sufficient to use to quickly manipulate strings.