Friday, August 24, 2007

Why is manipulating the DOM hard?

Every browser has its own JavaScript rendering engine and it has its own DOM layout engine. TheW3C standardized the DOM in 1998, but browsers have been slow to provide uniform support of theW3C standards. Microsoft’s IE uses a DOM layout engine called Trident (or MSHTML), all Mozillabased browers (including Firefox and Netscape) use the open source Gecko layout engine, Safari usesApple’s WebCore, and Opera uses its own proprietary Presto layout engine. All engines support DOM1.0, but support for the later DOM 2.0 and 3.0 is still spotty.

Msxml2.XMLHTTP vs. Microsoft.XMLHTTP

If you look at different implementations of Ajax, you’ll notice that some use “Microsoft.XMLHTTP”and some use “Msxml2.XMLHTTP” when targeting IE’s ActiveX control. So what’s the difference? Asit turns out, very little when written like that. While the “Microsoft” namespace is older than the“Msxml2” namespace, written like this both statements will target MSXML 3.0 (the most widelydistributed version of MSXML). The latest version of MSXML, though, is version 6.0 (released July2006). Vista ships with version 6.0 installed and it is available for download for XP, Win2k, andWin2k3. To target the latest and most secure version of MSXML, you must use“Msxml2.XMLHTTP.6.0” to create your XMLHttpRequest. Leaving the version number off on a systemwith 3.0 installed will always target MSXML 3.0 (even if 6.0 is installed)

Why is JavaScript hard to write?

In part, it is because every browser handles JavaScript just a little differently. Any web browser thatwants to support JavaScript must provide its own engine to parse JavaScript commands and performthe correct browser actions.
Firefox uses the open source JavaScript engine called SpiderMonkey,
Safari uses an engine called JavaScriptCore, and
Opera uses its own proprietary engine.
IE’s engineactually processes “JScript", Microsoft’s own brand (Iiteraly) of JavaScript created (in part) to avoidcopyright issues with JavaScript trademark holder Sun. Even though “JavaScript” is standardized byEcma, each engine does things a little differently. That means solid JavaScript or Ajax programmingmust be done in a way that accounts for these differences. Aren’t you glad you use the Telerik magicnow?

Thursday, August 23, 2007

Get Registry Data of Client's machin

Hi Friends,
It is very easy to get server's information from asp page, by using server variables but it is big task to read client's information from web page.

Scenario : Client wants to save records of all user's system (configuration e.g. processor,memory etc), who opened your site in there pc or laptop.

Solution : Create object of Wscript.Shell and read registry with Key name
Code :
Public Function ReadRegistry()
Dim ComputerName
Dim What
response.write "read"
'get computer name
ComputerName = wsho.RegRead"HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName")
If ComputerName = "WINME" Then
What = mes
End If
If ComputerName = "WINXP" Then
What = mas
End If
response.write "computer name is " & ComputerName
End Function

This code will print only computer name, same way you can read all information of Registry from client's machine.

Cheers !!!!!

Wednesday, August 22, 2007

Problem with Excel Data Import in SQL Server

Hi Friends,

I'll describe something that I no longer have the documentation for, but it might point you in the right direction. I ran across a situation where I was opening an Excel file as a database from within VB (using Jet OLEDB I think). Sometimes I would get null values from cells that contained real data. What I found out was going on was that it would do a 10-row scan to try to guess what the datatype was for each column. There was a setting in the Registry that I was able to set in order to force it to scan the entire sheet before it decided what datatype I had. MAYBE you're running into a similar scenario with Excel trying to guess the datatype, deciding it's a number, and thus stripping your leading characters. Of course you could always import to a temp table and then pad with leading zeroes to 5 spaces upon insertion into the real table. Or you could create a computed column in the real table that does the padding and use the computed column in your BETWEEN statement instead of the real column.

Also Check http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q257/8/19.asp&NoWebContent=1 and look about 1/3 way down for "Rows to Scan". This only talks about the ADO connection. It's just a WAG on my part that it might also apply to the Excel Import. You can also check the TypeGuessRows setting in HKLM\Software\Microsoft\Jet\4.0\Engines\Excel\TypeGuessRows or the MaxScanRows in HKLM\Software\Microsoft\Jet\4.0\Engines\Text\MaxScanRows

Considerations That Apply to Both OLE DB Providers
A Caution about Mixed Data Types


As stated previously, ADO must guess at the data type for each column in your Excel worksheet or range. (This is not affected by Excel cell formatting settings.) A serious problem can arise if you have numeric values mixed with text values in the same column. Both the Jet and the ODBC Provider return the data of the majority type, but return NULL (empty) values for the minority data type. If the two types are equally mixed in the column, the provider chooses numeric over text.For example:

• In your eight (8) scanned rows, if the column contains five (5) numeric values and three (3) text values, the provider returns five (5) numbers and three (3) null values.
• In your eight (8) scanned rows, if the column contains three (3) numeric values and five (5) text values, the provider returns three (3) null values and five (5) text values.
• In your eight (8) scanned rows, if the column contains four (4) numeric values and four (4) text values, the provider returns four (4) numbers and four (4) null values.As a result, if your column contains mixed values, your only recourse is to store numeric values in that column as text, and to convert them back to numbers when needed in the client application by using the Visual Basic VAL function or an equivalent.To work around this problem for read-only data, enable Import Mode by using the setting "IMEX=1" in the Extended Properties section of the connection string. This enforces the ImportMixedTypes=Text registry setting. However, note that updates may give unexpected results in this mode.

Maximum size of Query String

The maximum URL length allowed by Internet Explorer is ~2,048 characters. This includes the host name, directory, page, and all parameters.