CS-dotnet

http://www.internet.com/icom_cgi/print/print.cgi?url=http://www.15seconds.com/issue/030623.htm

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) 15Seconds.com

21-Aug-03

http://www.15seconds.com/

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

2) A C# property

12-Apr-04

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;
   }
}

http://www.yoda.arachsys.com/

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.


this.ComboBox1.DataSource 
   = Enum.GetNames( typeof ( YourEnum ));

Then to get it back out.


YourEnum val 
   = (YourEnum) Enum.Parse(typeof(YourEnum)
          ,comboBox1.SelectedItem.ToString());

Masterpages are keys in constructing websites in asp.net. 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 asp.net web page

Introduction

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.

Prerequisites

it is assumed that you are familiar with the general idea of asp.net 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.

asp.net column gridview widths

asp.net dataview empty datasource display header footer

asp.net masterpages

asp.net populating, working with datatable objects

asp.net validation basics

asp.net what happens to the view state of data variables on the page?

asp.net: how to submit a web fom

asp.net: Viewstate and dynamically added controls

20) aspire.net samples

6-Jun-07

aspire.net samples

basic class structure in c#

creating a table in oracle

24) data binding samples

15-May-07

data binding samples

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

Feature changes in Asp.net 2.0

http://www.websupergoo.com/helpupload50/source/2-tech_notes/3-web.config.htm

httpRuntime
maxRequestLength
executionTimeout
sessionstateTimeout
responseDeadLockInterval

Getting Data from Oracle in asp.net

30) gridview onrowcommand

9-Jun-07

How to fire actions from a gridview
gridview onrowcommand
datakeys
buttonfield
buttonfieldtype
commandname

31) GridView samples

6-Jun-07

GridView samples

32) gridview selectedindex

28-May-07

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

Overloading
virtual and overriding
hiding
return types

The plot seems thicker than what the subject seem to indicate

class a
{
    a():base(){}
    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));
dataSet.Tables.Add(dataTable);

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
XmlArrayItem
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
NewWindow2
184876
311282
IWebBrowser2
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 asp.net

27-May-04

http://www.asp101.com/lessons/

Basic composition/structure of an aspx page

is it possible to add an edit field to a datacontrolfield

61) LINQ Notes

14-Nov-05

Linq

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

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

Naming controls in aspx pages

64) oracle 10g

21-Apr-07

oracle 10g

67) Sample sql syntax

24-May-07

Sample sql syntax

Things you shouldn't be asking in asp.net

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">
</asp:GridView>

Sample code for binding to this dataset


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //this.testTable
        this.testGrid.DataSource = getSampleDataset();
        this.testGrid.DataBind();
    }
    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;
    }
}//eof-class

what is the Data Binding Syntax in ASP.NET 2.0

73) what is XDR?

10-Apr-07

what is XDR?

what's up with asp.net isValid function

where does console output go for asp.net web applications

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