Wednesday, January 28, 2009

Binding XML to GridView in .NET

1) xmlDataSource control.
- Add xmlDataSource control to ASP, with ID
- Codebehind: Add method "data" to control.
- Data might need method MSXML2.ServerXMLHTTP.open
- May need method TransformFile (for xsl)
- Add method Databind()


2) DATASET
- Instantiate a Dataset
- Use Dataset.ReadXML method. Pass Request.PhysicalApplicationPath + "File.xml"
- Set Gridview's Datasource to be dataset.
- May set GridView GridView1.DataMember to a node.
Where: http://www.codeproject.com/KB/aspnet/Bind_XML_file_to_GridView.aspx

Streamreader

' Open a file using StreamReader.ReadtoEnd
' (many other Streamreader methods available)

Dim FILENAME As String = Server.MapPath("CC emails.txt")
Dim objStreamReader As StreamReader
objStreamReader = File.OpenText(FILENAME)
Dim newEmail As String = objStreamReader.ReadToEnd()
objStreamReader.Close()

Monday, January 26, 2009

How to Reset TCP/IP, proxy and DNS In Windows

run as admin in command line.


NETSH INT IP RESET

NETSH WINHTTP RESET PROXY

IPCONFIG /FLUSHDNS