Working with DB2, from a .NET application developer's perspective, is just like working with any other relational database. One can find endless examples of how to perform databases tasks (from the mundane to the interesting) for Microsoft SQL Server and Oracle, but there is not as much similar documentation for accessing DB2 from Microsoft technologies, including .NET.



1. .net resources
2. data access technologies
3. articles

2) A C# property


A C# property

public class SimpleProperty 
   private int number = 0;
   public int MyNumber 
   get {  return number; }
   set {  number = value;}
public class UsesSimpleProperty
   public static void Main()
      SimpleProperty example = new SimpleProperty();
      example.MyNumber = 5;
      int anumber = example.MyNumber;

This has nice section on static initializers and static constructors

. Create a dummy xml
. use xsd.exe to create the .xsd file
. use Visual studio to tweak the XSD for a) cardinality and b) data types

Caveat: There may alternate ways to generate the complex types in the XSD than the default approach that XSD takes. Nevertheless it should work.

Idea of a web page control in .net

adding template columns

Credits: Paul Montgomery

To set a combo box ( or list box ) to all of the values in an enum, do the following.

   = Enum.GetNames( typeof ( YourEnum ));

Then to get it back out.

YourEnum val 
   = (YourEnum) Enum.Parse(typeof(YourEnum)

Masterpages are keys in constructing websites in They provide the background for a website such as the top banners, left hand navigation, footer etc. In this exercise you will need to

  1. Create a basic empty website
  2. create a main master page (banner, left hand menu, footer)
  3. create a web page that will use that master page
  4. Create a child/nested master page (provide a page menu on the right)
  5. create a web page that uses the nested master

Anatomy of an web page


For an experienced html web programmer it shoudl be really quick to start writing code in any framework as the concepts are similar. This article will give you a quick start to start developing web pages while highlighting the important elements with out fluff. This information is distilled from a number of web sources and also books.


it is assumed that you are familiar with the general idea of where html controls are represented as server side control objects. The web page with an extension of .aspx will contain the placement and configuration of these control. The codebehind file contains the manipulating logic for these controls.

This exercise

The goal of this exercise is to display the output of a select statement in a data grid. Make one of the columns hyperlinked so that one can see the details in a separate web page. The deliverables are two aspx pages with their respective code behind files. column gridview widths dataview empty datasource display header footer masterpages populating, working with datatable objects validation basics what happens to the view state of data variables on the page? how to submit a web fom Viewstate and dynamically added controls

20) samples

6-Jun-07 samples

basic class structure in c#

creating a table in oracle

24) data binding samples


data binding samples

Some ideas on how to deal with database nulls in the .net world

Feature changes in 2.0


Getting Data from Oracle in

30) gridview onrowcommand


How to fire actions from a gridview
gridview onrowcommand

31) GridView samples


GridView samples

32) gridview selectedindex


gridview selectedindex

How best to create a solution for web site projects

How can I add an existing project to a website solution

How can I look up a class ref quickly in dotnet

How can I use hyperlinkfield in dataview

sample code for walking through a data set

How come I dont see web.config in visual studio 2005

How come runat is needed at high level tags?

class a{};
object o;
if (o is a)
do something;
m_timer.Interval = Convert.ToInt32(m_interval) * 1000;
Explains derivation in c#, calling base class etc.
array examples: Instantiating, type checking, string splitting

How does data binding work in a templated item

This article will address the following

virtual and overriding
return types

The plot seems thicker than what the subject seem to indicate

class a
    a(string b):this(){}
    a(int a): this("hello") {}
Some notes on .net exceptions

DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable("table1");
dataTable.Columns.Add("col1", typeof(string));

string xmlData = "<XmlDS><table1><col1>Value1</col1></table1>";
xmlData += "<table1><col1>Value2</col1></table1></XmlDS>";

System.IO.StringReader xmlSR = new System.IO.StringReader(xmlData);

dataSet.ReadXml(xmlSR, XmlReadMode.IgnoreSchema);

How can I retrieve the form elements on serverside in dotnet

How to stream an object as XML to a string
Controlling root and root field name
Controlling array elements
More sample code
char[] sepString = new char[]{'1'};
string[] userIdList = customerIdList.Split(sepString);
To upper case it: ctrl-shift-u
To lower case it: crl-u

how to work with dotnet table control?

Randy Connolly
Scott Allen
Dino Esposito
Scott Guthrie
Jimmy Nilsson
Ted Pattison
Fritz Onion
Scott Mitchell
Rick Strahl

Important for googling

When an internet explorer control is embedded in a power builder window, the internet explorer seem to loose session cookies for popups. Obviously this is not desirable for a reason. This drawback prevents from embedding fully functional web applications inside of a client server systems such as those built powerbuilder, delphi, or home grown.

While searching for the related material in google it might interest the reader to note the following key words in their order of narrowness/importance descending.

NewWindow2 powerbuilder
ie new window session cookies

You can use the following url to brush up on your c# skills

See the list of c# questions

59) Introductory


Basic composition/structure of an aspx page

is it possible to add an edit field to a datacontrolfield

61) LINQ Notes



HttpPostedFile postedFile		= Request.Files["fieldname"];
if (posterFile != null)

Read the full story for limitations and work arounds for file sizes greater than 4M.

Naming controls in aspx pages

64) oracle 10g


oracle 10g

67) Sample sql syntax


Sample sql syntax

Things you shouldn't be asking in

what are the default methods on a page object

A simple aspx page with a datagrid

<h2>A sample data grid</h2>

<asp:GridView ID="testGrid" runat="server">

Sample code for binding to this dataset

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)
        this.testGrid.DataSource = getSampleDataset();
    private DataSet getSampleDataset()
        DataSet ds = new DataSet();
        string xmlData = "<XmlDS>";
        xmlData+= "<table1><col1>Value1</col1><col2>value</col2></table1>";
        xmlData += "<table1><col1>Value2</col1><col2>value</col2></table1>";
        xmlData += "<table1><col1>Value2</col1><col2>value</col2></table1>";
        xmlData += "<table1><col1>Value2</col1><col2>value</col2></table1>";
        xmlData += "<table1><col1>Value2</col1><col2>value</col2></table1>";
        xmlData+= "</XmlDS>";
        System.IO.StringReader xmlsr = new System.IO.StringReader(xmlData);
        ds.ReadXml(xmlsr, XmlReadMode.InferSchema);
        return ds;

what is the Data Binding Syntax in ASP.NET 2.0

73) what is XDR?


what is XDR?

what's up with isValid function

where does console output go for web applications

c# strings
1. Convert date/times to strings
2. A listing of datetime formats