Thursday, June 25, 2009

Populating a .NET Gridview using PostGreSQL

This is an unlikely scenario in a company: a .NET app that needs to connect to PostGreSQL, but it's seamless when you use a Data Access Component from Devart. Then all you have to do is add a reference to your project and import the namespace.

Here's a diagram representing objects available for data access to bind to a gridview. Blue groups represent objects, yellow rectangles are methods, rounded rectangles are parameters.

Monday, June 15, 2009

Web page Analysis 03

Here's a more involved approach for showcasing design work. Requires a bit more manual labor as far as making pages.

Web page analysis 2

Here's the result of analyzing another designer website, which seems simpler when you navigate it but it actually is somewhat more complicated, although pretty good as well.

Web Page Flow Analysis 1

I had the urge to do navigation analysis of some websites that feature web design work. Here is the result of one website. Simple but works very well.

Tuesday, June 09, 2009

XML to Dataset in .NET

I've been exploring the various ways that .NET offers to parse XML files. Luckily it seems like the more I learn, the simpler ways I discover to do a small task. This small task is to read an XML file and show it in a DataGrid. I found it in this website .

Putting it all together

You will need to add an XML file into your build. For this sample, this is the XML file. <?xml version="1.0" encoding="utf-8" ?><family> <name gender="Male"> <firstname>Tom</firstname> <lastname>Smith</lastname> </name> <name gender="Female"> <firstname>Dale</firstname> <lastname>Smith</lastname> </name></family>

In a new VB Windows form, add a DataGrid, call it grdData. Add a button to handle your event, and put this code:

Imports System
Imports System.Data
Imports System.Data.SqlClient

Public Class ReadXMLtoDataset

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dsPubs As New DataSet()
' Read in XML from file
' Bind DataSet to Data Grid
grdData.DataMember = "name"
grdData.DataSource = dsPubs
Catch ex As Exception
End Try
End Sub
End Class

This is a simple way of putting together a quick bind to an XML file.