April 2017
M T W T F S S
« May    
 12
3456789
10111213141516
17181920212223
24252627282930

Archives

Meta

Recent Posts

Tags

asp .net asp .net membership browsers computer crash Guy Burstein javascript link-o-rama LINQ office 2007 optimization outlook 2007 performance ScottGu SQL Server t-sql web servers workarounds xmlhttprequest

Vroom, vrooom…. aka Making Pages Load Faster

By juliana | May 7, 2008

Optimizing Page Load Time [die.net]
Best Practicies for Speeding up your Web Site [Yahoo]

Interesting stuff, some excerpts for own reference below the more tag.
Read the rest of this entry »

Click on pen to Use a Highlighter on this page

Topics: Uncategorized | 33 Comments »

ASP .NET Membership: Where’s the UserID?

By juliana | April 25, 2008

I couldn’t figure this out intuitively, but good news: there is a way to get it from the MembershipUser class.

They don’t call it UserID (duh) but ProviderUserKey

dim user as MembershipUser = Membership.GetUser()
dim userGUID as GUID = user.ProviderUserKey
dim userID as String = user.ProviderUserKey.toString
Click on pen to Use a Highlighter on this page

Topics: I Canz Code! | 41 Comments »

SQL Server: Data types text / ntext won’t play with sort or LIKE.

By juliana | April 22, 2008

Msg 306, Level 16, State 2, Line 1
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

Pretty self-explanatory.

In order to compare or sort text/ntext, you need to convert it to varchar (or similar datatype that can allow compare/sort). Note, text/ntext often has a large capacity for data than varchar.

Edit:
COMPARISONS
When comparing (e.g. using LIKE or = ), convert the non text/ntext INTO text. One assumes it’d be something like this:

[...] WHERE TextDataTypeColumn like 'test%'

change to

[...] WHERE TextDataTypeColumn like cast('test%' as text)

Because you’re converting from a “smaller” data type to a larger data type, you never have to face the possibility that data may be trunctaed.

SORTING
I believe sorting will only work on varchar, so there’s no way around it.

When sorting, you’ll have to convert non text/ntext INTO varchar (and remember to give enough or as much space possible). One assumes it’d be something like this:

[...] ORDER BY TextDataTypeColumn

change to

[...] ORDER BY cast(TextDataTypeColumn as varchar(500))
Click on pen to Use a Highlighter on this page

Topics: I Canz Code! | 39 Comments »

LINQ here, LINQ there, LINQ everywhere

By juliana | April 22, 2008

According to DA GURU (that’s Scott Guthrie), on his article LINQ to SQL (Part 5 – Binding UI using the ASP:LinqDataSource Control)

We will also take advantage of the built-in paging/sorting support within LINQ to SQL to ensure that features like the product listing paging/sorting are performed not in the middle-tier, but rather in the database (meaning only 10 products are retrieved from the database at any given time – we are not retrieving thousands of rows and doing the sorting/paging within the web-server).

Emphasis mine.

Whoohoo! Automatic server side paging. Srsly? Must read more and find a way to implement. Never mind that I’ve already done my stored procedures for the old way of doing server-side paging; this is worth the investment. (Even if some people don’t think so.)

Read the rest of the article here.

ETA: After digging through the articles, I’ve come to the conclusion that this automatic paging only works if you’re LINQ’ing directly to the database tables (e.g. using LINQ expression/syntax). The interface takes care of the iteration so that it only draws out the necessary rows. However, I believe if you’re using LINQ to access a stored procedure, you lose this automatic “skip and take” feature. At least, that’s what it seems to me. Throwing a SP into the DBML only exposes the SP interface, but LINQ would be able to go into the stored procedure and optimize it. So, in order to do paging by LINQ , the stored procedure would have to retrieve all the rows (think: virtual table, except this one has to be constructed completely and wholly every time it’s called) and hand it off the LINQ. Yeouch.

Click on pen to Use a Highlighter on this page

Topics: I Canz Code! | 19 Comments »

ASP .Net says: Look, Ma, I’m a Javascript!

By juliana | April 19, 2008

Here’s was my problem yesterday, in a cool scripted form:

Mission> Your mission, should you choose to accept, is to allow third party sites to grab from this system you are developing and display our content. These undisclosed third party sites may be in ASP .Net, ASP, PHP, or even… [ominous pause] static HTML. You have no choice but to accept this mission. You may begin self-destructing in 5, 4, 3…

Me> No problem! I’ll use Javascript! I’ll use XMLHttpRequest object! Cool!

Javascript/XMLHttpRequest> Permission denied to call method xmlhttprequest.open.

Me>Um..

JS/XHR> Permission denied to call method xmlhttprequest.open. Bwhahahaha!

Me> Err..

JS/XHR>Permission denied to call method xmlhttprequest.open! Permission denied to call method xmlhttprequest.open! PERMISSION DENIED TO CALL METHOD XMLHTTPREQUEST.OPEN! NEENER NEENER!!

Me> ARGH! ::DIES::

Apparently, XMLHttpRequest does not allow cross-domain scripting for security reasons. I didn’t realize this because I’d always use the object for local connections, but I get it. Cross-domain scripting can lead to some pretty malicious results in the hands of an evil developer. But that doesn’t solve my problem.

Read the rest of this entry »

Click on pen to Use a Highlighter on this page

Topics: I Canz Code! | 36 Comments »

Outlook 2007 Installation Nitemare

By yuthavong | April 18, 2008

  1. 9th April from 9pm till 5am next day
  2. outlook 2007 configuration nightmare
  3. from one error to another even after installing patches and SP1
  4. tried total removing of office (http://support.microsoft.com/kb/928218) which includes Registry changes
  5. solutions
  6. run MS Office diagnostic if Error#1 occurs
  7. copy RTFHTML.dll into windows\system32 to prevent below common errors #1 & #2
  8. set loadbehaviour to zero for edatasecurity section within registry to prevent pop up configuration
  9. if unable to remove data files, add new profile at control panel/mail/profile
  10. outlook app version 12.0.6300.5000
  11. comments
  12. outlook 2007 does not work flawlessly with Acer
  13. there’s no proper solutions from MS site, only to get repeated message to allow liveupdate to take place
Errors Captured#1

Problem Event Name: APPCRASH

Application Name: OUTLOOK.EXE

Application Version: 12.0.6300.5000

Fault Module Name: ntdll.dll

Errors Captured#2

Problem Event Name: APPCRASH

Application Name: OUTLOOK.EXE

Application Version: 12.0.6300.5000

Fault Module Name: kernel32.dll

Technorati Tags: ,,
Click on pen to Use a Highlighter on this page

Topics: Applications | 36 Comments »

Hello world!

By admin | April 17, 2008

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

Click on pen to Use a Highlighter on this page

Topics: Uncategorized | 13 Comments »


Next Entries »