Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Colt Kwong Blog

.NET is out there

  • FAQ for Email Sending in ASP.NET

    Email sending in ASP.NET is very easy! There's a library named "System.Web.Mail" provide a easy emailing services for ASP.NET Developers, we can prepare and send an email from our Web application in just 1-2 lines of codes. Moreover, Web Matrix provide a Code Wizard which contain a Email Sending module/wizard which will generate the code to send email in a visual way.

  • System.Data.SqlClient.SqlException: Login failed for user 'MachineName\ASPNET'

    I'm not sure how many of you are using MSDE as your backend data store, but Web Matrix inborn work naturally with the MSDE Database. Even in the Guided Tour of Web Matrix (which is a tutorial for Web Matrix user and step-by-step samples for users) also have an appendix specialized in MSDE installation).

    "Login Failed for user XXX\ASPNET" is a FAQ in the Forums, I think I saw and moderate this kind of questions over thousands of times. Dave post a FAQ for this subject some times ago, while an ASP.NET Team member - MikePope - answer a question for that problem again recently.

    Abstract:

  • ASPNET Worker Process Recycled?!

    I received a ad-hoc task for retrieving, sorting and filtering data from a Excel file tonight, it's pretty simple and straighforward - Just use an appropriate connectionString in ADO.NET then I can connect to the 'data source' and manipulate the data directly.

    However, I 'hang' for about 5 minutes in front of my workstation in the process! There're two problems which were sucking me:

    1. A Excel worksheet was used as a Data Source by user, well, I understand this situation as users are more familiar with the Office products sense, but the point is that the single worksheet contain >= 20Mb of data, which take me l..o..n..g.. time in loading. 20Mb is a insignificant size when storing in a SQL Server, but loading up a 20Mb Excel file is really face a heavy performance penalty. (More info: The file is connected and filled with data from a SQL Server, but I'm not authorized to access to this Server directly, don't laugh at me)

    2. An error message with something like "aspnet worker process recycled" displayed when I was retrieving the data from the 'data source'. Next, I go to open up my Event Viewer and see what's going on. The reason is something like "Insufficient memory - the ASP.NET process take > 60% of my physical memory". Ah.... I have 256Mb physical RAM in my workstation and... I don't want to waste time in this issue but just search and scan a similar Kb from Microsoft support site.

    Finally, my solution is to break down the amount of data to be SELECT for retrival in order to 'avoid' this problem, I don't want to spend more time in investigating or trying to solve this problem tonight, as I want to completed my task ASAP and off - I've
     stayed in office for nearly 12 hours already.

    Inproper way for problem-solving and learning? or reply to user in the shortest response time? Who win? Excel or XML or other Data Source will you suggest to users?