background preloader

How To's

Facebook Twitter

On the Way to Mastering ASP.NET: Introducing Custom Entity Classes. Karl Seguin March 2005 Summary: There are situations for which untyped DataSets may not be the best solution for data manipulation.

On the Way to Mastering ASP.NET: Introducing Custom Entity Classes

The goal of this guide is to explore an alternative to DataSets: custom entities and collections. (32 printed pages) Contents IntroductionProblems with DatasetsCustom Entity ClassesObject-Relational MappingCustom CollectionsManaging RelationshipsBeyond the BasicsConclusion Introduction The days of ADODB.RecordSet and the oft-forgotten MoveNext are gone, replaced by the powerful and flexible capabilities of Microsoft ADO.NET. As our tools have evolved, so too have our development patterns. While DataReaders might have been familiar (they behave a lot like RecordSets), it didn't take long for us to venture forward and explore DataAdapters, DataSets, DataTables, and DataViews.

There are a number of situations for which DataSets are particularly well suited, such as prototyping, small systems, and support utilities. Problems with Datasets Lack of Abstraction.

Screen Scraping

Cast Examples, Conversions. .NET Array Dictionary List String 2D Async DataTable Dates DateTime Enum File For Foreach Format IEnumerable If IndexOf Lambda Parse Path Process Property Regex Replace Row Sort Split Static StringBuilder Substring Switch Tuple Window Casts.

Cast Examples, Conversions

Casting variables is complex. A set of rules resolves casts. In some cases data is lost and the cast cannot be reversed. In others an exception is provoked.Conversions, specified as methods or operators, are often required. Is, as:With the is-operator we cast an object reference. So:The StringBuilder is converted to an object and then back into a StringBuilder reference. Int.Parse, TryParse: Convert Strings to Integers. .NET Array Dictionary List String 2D Async DataTable Dates DateTime Enum File For Foreach Format IEnumerable If IndexOf Lambda Parse Path Process Property Regex Replace Row Sort Split Static StringBuilder Substring Switch Tuple Window Parse.

Int.Parse, TryParse: Convert Strings to Integers

Strings often contain data like integers or times. In computer programs, having an int is often more useful than a string. It can be tested in more ways.With parse methods, like int.Parse, we convert strings into low-level types (like ints). Asp.net - how can i make Valdator's color red? Creating ASP.NET Web Projects in Visual Studio 2013. This topic explains the options for creating ASP.NET web projects in Visual Studio 2013 with Update 3 Here are some of the new features for web development compared to earlier versions of Visual Studio: A simple UI for creating projects that offer support for multiple ASP.NET frameworks (Web Forms, MVC, and Web API).

Creating ASP.NET Web Projects in Visual Studio 2013

ASP.NET Identity, a new ASP.NET membership system that works the same in all ASP.NET frameworks and works with web hosting software other than IIS. The use of Bootstrap to provide responsive design and theming capabilities. New features for Web Forms that used to be offered only for MVC, such as automatic test project creation and an Intranet site template. For information about how to create web projects for Azure Cloud Services or Azure Mobile Services, see Get Started with Azure Cloud Services and ASP.NET and Creating a Leaderboard App with Azure Mobile Services .NET Backend. This article contains the following sections: Prerequisites Empty Template Web Forms Template Domain. Using Unobtrusive Validation in ASP.NET 4.5 Web Forms. Originally published June 21, 2012.

Using Unobtrusive Validation in ASP.NET 4.5 Web Forms

Last updated May 17, 2013. Introduction. How to pass value from popup window to parent page in ASP.Net. String.IsNullOrEmpty Method (String) (System) .NET Framework 4.6 and 4.5 public static bool IsNullOrEmpty( string value ) Return Value true if the value parameter is null or an empty string (""); otherwise, false. result = s == null || s == String.Empty; The following example examines three strings and determines whether each string has a value, is an empty string, or is null. using System; class Sample { public static void Main() { string s1 = "abcd"; string s2 = ""; string s3 = null; Console.WriteLine("String s1 {0}

String.IsNullOrEmpty Method (String) (System)

Passing value from popup window to parent form's TextBox. Passing values from a popup window back to the parent page is an often asked question.

Passing value from popup window to parent form's TextBox

Especially when there is a GridView type control in the popup. In the following example we will be using two forms. Asp.net - How to align asp:Menu in DIV tag? HOW TO: Access ASP.NET Intrinsic Objects from .NET Components Using Visual Basic .NET. C# - Difference between is and as keyword.