Monthly Archives: July 2004

mozdev.org – forumzilla: index

I’ve been looking around for a nice app to read some of my favourite blogs. I only want to see if a new item gets posted, and so I was pleased to discover forumzilla – an extension for the Mozilla Thunderbird mail client.

It is a fairly basic extension, and it will only reall;y display the title of the post, but for me, for now – that’s enough.

Output the contents of a DataSet in HTML

private void PrintRows(DataSet myDataSet)
{
  // For each table in the DataSet, print the row values.
    foreach(DataTable myTable in myDataSet.Tables)
    {
      foreach(DataRow myRow in myTable.Rows)
      {
        foreach (DataColumn myColumn in myTable.Columns)
        {
          Response.Write(myRow[myColumn] + "
"); } } } }

This method is called with

printRows(<datasetname>)

Populate a DataSet from a table in a database

// Database is called “MarcTest1″
// Table is called “phonebook”
// DataSet is called “ds”

string m_Connect = “Data Source=(local);integrated security=SSPI;Initial Catalog=MarcTest1;”;
SqlConnection myConn = new SqlConnection(m_Connect);
SqlDataAdapter da = new SqlDataAdapter();
myConn.Open();
DataSet ds = new DataSet();
string sQueryString = “”;
sQueryString = “SELECT * FROM phonebook”;
da.SelectCommand = new SqlCommand(sQueryString,myConn);
da.Fill(ds, “ImportTable”);
myConn.Close();