Tuesday, July 24, 2007

Interview Questions

- Write a factorial function with C# in ONE LINE.

- What if you pass an array in a C# function change items in that array, and then try to access the content of the array outside of the function. Will be still see the changes the funciton made?
What if you use the out keyword?

(Druing the interview, I confused the out keyword and the ref keyword.)

- What is the new datatype provide in ADO.Net 2.0

- How to code HTML table?
(I can't believe that they are still coding HTML in notepad fashion. And they haven't move to CSS yet. .....)

- How do I effectively display 500 records on a DataGrid with paging , and with optimized both the network traffic and the machine resources?

Monday, July 16, 2007

Add Data Access block (Enterprise Library 3.1) to my project

Here's how I add Data Access block (Enterprise Library 3.1) to my current project instead of adding the packaging to my solution:

- Install Enterprise Library 3.1
- After the installation done, find the source code directory.
- Copy the two folder "Common" and "Data" and the two files GlobalAssembllyInfo.cs and localtestrun.testrunconfig in a local directory.
- Include the two projects in my own project.
- Compile, and it should be fine.

To use it, include libraries like:
System.Data
System.Data.SqlClient
Microsoft.Practices.EnterpriseLibrary.Data
System.Data.Common

Thursday, July 05, 2007

Error when debugging ASP.Net 2.0 site with VS.Net 2K5?

(NT AUTHORITY\NETWORK SERVICE) does not have write access -- same problem again

I encounted the "The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'." error again, and this time I have to give access right to the user "NETWORK SERVICE". And the funny thing is that I DID NOT KNOW there's a user called "NETWORK SERVICE" before. Oh well, better late than never.