Wednesday, 14 October 2009
oledbdatareaderclass
http://authors.aspalliance.com/aspxtreme/sys/Data/oledb/oledbdatareaderclass.aspx
Tuesday, 13 October 2009
Monday, 12 October 2009
How To: Reading and Writing Text Files
Writing to a Text File
Listing 1: Writing Text Data to a File: TextFileWriter.cs
Reading From a Text File
Listing 2 shows how to read from a text file:
Listing 2: Reading Text Data from a File: TextFileReader.cs
Listing 1: Writing Text Data to a File: TextFileWriter.cs
using System;
using System.IO;
namespace csharp_station.howto
{
class TextFileWriter
{
static void Main(string[] args)
{
// create a writer and open the file
TextWriter tw = new StreamWriter("date.txt");
// write a line of text to the file
tw.WriteLine(DateTime.Now);
// close the stream
tw.Close();
}
}
}
Reading From a Text File
Listing 2 shows how to read from a text file:
Listing 2: Reading Text Data from a File: TextFileReader.cs
using System;
using System.IO;
namespace csharp_station.howto
{
class TextFileReader
{
static void Main(string[] args)
{
// create reader & open file
Textreader tr = new StreamReader("date.txt");
// read a line of text
Console.WriteLine(tr.ReadLine());
// close the stream
tr.Close();
}
}
}
URL Rewriting in >NET
<urlMappings configSource="Mapping.xml" />
Mapping.xml
<?xml version="1.0" encoding="utf-8" ?>
<urlMappings>
<add url="~/Page1.aspx" mappedUrl="~/Default.aspx?ID=1" />
<add url="~/Page2.aspx" mappedUrl="~/Default.aspx?ID=2" />
</urlMappings>
Mapping.xml
<?xml version="1.0" encoding="utf-8" ?>
<urlMappings>
<add url="~/Page1.aspx" mappedUrl="~/Default.aspx?ID=1" />
<add url="~/Page2.aspx" mappedUrl="~/Default.aspx?ID=2" />
</urlMappings>
Monday, 17 August 2009
Monday, 1 June 2009
Force IE8 into compatibility mode
<meta equiv="X-UA-Compatible" content="IE=EmulateIE7">
More...
http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx
More...
http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx
Sunday, 31 May 2009
SQL - Useful Functions
Get Employees first name:
SELECT SUBSTRING(Name, 1, CHARINDEX(' ', Name)) AS FirstName
Friday, 22 May 2009
System.Web.HttpContext
System.Web.HttpContext.CurrentContext.Response.Write("");
System.Web.HttpContext.Current.User.Identity.IsAuthenticated
System.Web.HttpContext.Current.User.Identity.IsAuthenticated
Subscribe to:
Comments (Atom)