A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Monday, June 2, 2008

Insight of new version of Internet Explorer IE 8

Microsoft has kept development of Internet Explorer 8 pretty quiet, but already the next major version of the most widely-used browser is available for downloading in a beta version.

While the focus of IE 7 was on security and the incorporation of a tabbed interface, version 8's main features center on stability and usability.

In terms of stability, IE 8's new automatic crash recovery feature is designed to solve one major problem that most IE users know all too well. Today, when an IE window or tab freezes or crashes, other browsers instances or tabs will likely become inoperable as well.

Automatic crash recovery does a better job of isolating instances of the IE browser - or separate tabs within the same browser - so that one stalled browser or tab can be terminated without affecting any other.

If a crash does bring down the entire browser, automatic crash recovery will attempt to restore the browser to its previous state - including all open tabs - the next time you open it.

Greater stability is fine - but ultimately boring. Luckily, that's not all IE 8 has going for it. The new browser's usability features will generate the most buzz - and are likely to tempt lots of folks to give IE 8 a try.

The new Activities feature, for instance, attempts to save you a lot of times by cutting down on the number of separate sites that you have to visit to accomplish a task. In essence, the Activities feature allows you to invoke the essential services offered on separate sites without ever leaving the page you're currently on.

Let's say, for example, that you're reading a web page and you see an address for a restaurant you'd like to visit.

Today, in order to get directions to that address, you would probably go to a mapping site and type or paste the address in and then wait for the service to provide you with a map from, say, your apartment to the restaurant.

The process is time-consuming and involves at least two browser windows and tabs, plus a bit of copying a pasting.

With IE 8's Activities feature, when you select the address, a small Activities button appears next to your mouse cursor. Clicking that Activities button brings up a context-sensitive menu of possible activities, with one of the options being the ability to map the tool using your favorite mapping site.

 
Selecting that mapping option actually invokes the mapping site in a smaller preview window inside the current browser tab.


Another Activity might pull from a review site of restaurants, allowing you to see what others have said about the restaurant without your having to visit another site.

 
The Activities feature was also created with a nod toward the growing popularity of social networking sites. Just as you can pull services from other sites, the Activities feature also allows you to push information to popular networking sites such as Facebook and Digg.

 
If you want to refer a friend to the page from which you got the address for the restaurant, for instance, you can select the Send to Facebook option on the Activities menu, and IE 8 will log you into Facebook, send the URL to Facebook, and present you with the Facebook page that allows you to add an entry.

 
A set of default Activities comes with the IE 8 browser, but you easily customise the service providers that appear on your Activities list.

 
Another time-saving feature of IE 8 is called Web Slices, which are designed to allow you to subscribe to frequently-updated portions, or "slices," of certain Web sites.


Instead of spending your time visiting three or four Web sites to get updated information from a portion of each of those sites, you would simply use Web Slices to pull that information into a single location in IE 8.

A site such as eBay, for instance, lends itself to the Web Slices feature.

Say, for instance, that you're running or watching several auctions on eBay. Typically, you would visit eBay multiple times per day to check the status of those auctions.

With Web Slices, you can instead simply subscribe to a section of the auction page by clicking a Web Slice icon that appears when you allow your mouse cursor to hover over a portion of a site that is frequently updated.

Clicking the Web Slice icon adds a new button to a Favorites bar that appears above your browser tabs. Clicking the newly-created Web Slice button on the IE 8 Favorites bar will pull the latest data from your subscribed page and show it to you in a preview window.

You can visit the page itself merely by clicking a link within the preview window.
 

As with Activities, Web Slice-enabled sections of sites must be made available by web site owners themselves. The code for doing so is fairly simple and non-proprietary, however, so it will likely simply be a matter of time before many sites become "IE 8 aware" and users start seeing the Activities and Web Slices icons as they surf their favorite sites.

 Download IE8 beta version here

HTML DOM Navigator Object

Navigator Object

The Navigator object is actually a JavaScript object, not an HTML DOM object.

The Navigator object is automatically created by the JavaScript runtime engine and contains information about the client browser.

IE: Internet Explorer, F: Firefox, O: Opera.

Navigator Object Collections

Collection Description IE F O
plugins[] Returns a reference to all embedded objects in the document 4 1 9

Navigator Object Properties

Property Description IE F O
appCodeName Returns the code name of the browser 4 1 9
appMinorVersion Returns the minor version of the browser 4 No No
appName Returns the name of the browser 4 1 9
appVersion Returns the platform and version of the browser 4 1 9
browserLanguage Returns the current browser language 4 No 9
cookieEnabled Returns a Boolean value that specifies whether cookies are enabled in the browser 4 1 9
cpuClass Returns the CPU class of the browser's system 4 No No
onLine Returns a Boolean value that specifies whether the system is in offline mode 4 No No
platform Returns the operating system platform 4 1 9
systemLanguage Returns the default language used by the OS 4 No No
userAgent Returns the value of the user-agent header sent by the client to the server 4 1 9
userLanguage Returns the OS' natural language setting 4 No 9

Navigator Object Methods

Method Description IE F O
javaEnabled() Specifies whether or not the browser has Java enabled 4 1 9
taintEnabled() Specifies whether or not the browser has data tainting enabled 4 1 9
 

Global Variables in JavaScript

Every tutorial that I've seen describes that to create a global variable you have to declare it outside the function.

var myvar = 5; function myFunction()    alert(myvar); // 5 }

And this is the way I've been doing it for years. The problem is, I've never been particularly happy about this. It never felt self contained. Then I thought, "Hey, why not just attach it to the window object?" I almost feel like an idiot for not having thought of this sooner and I suspect you JavaScripters out there are thinking "well, duh".

function setValue() {     window.myValue = "test"; }  function getValue() {     alert(window.myValue); // "test" (assuming setValue has run) }

A quick search via Google revealed just how "in the dark" I've been. It turns out that when a global variable is set, it's added to the window object!

var myValue; function setValue() {     myValue = "test"; }  function getValue() {     alert(window.myValue); // yup, it's "test" } Source: http://snook.ca/archives/javascript/global_variable/ 

Tuesday, May 27, 2008

A potentially dangerous Request.Form value was detected from the client

More details at ASP.Net site. At that site you also get some solutions, and I have read on the web that many people suggests changing web.config. That's a bad solution since it will affect all pages on your site.

Instead add a tag validateRequest="false" into the Page-directive on top of the page you want users to be able to input HTML and script tags.

Monday, May 19, 2008

ByRef vs ByVal

ByRef and ByVal

When getting the value of a variable from a procedure or function parameter you have two ways to request it. Either you can request for it to be passed ByRef (default), or ByVal.

Passing ByVal
Private Sub TestSub(ByVal strPath As String)

Passing ByRef
Private Sub TestSub(ByRef strPath As String) ' or just
Private Sub TestSub(strPath As String)

When you pass ByVal, Visual Basic passes a copy of the variable to the procedure. This way the procedure gets the value, but any changes it makes will not affect the original variable. 

When you pass ByRef, Visual Basic passes a pointer to the procedure. This is a reference so that the procedure knows where to find the variable in the memory. Any changes the procedure makes to this variable will effect the original one, as they are the same thing, however the variable does not need to be declared as public if you were wanting the procedure to access the variabl any other way. The following example shows the differences:

Sub Form_Load()
    Dim strTest As String
    '// fill the variable
    strTest = "Hello from Form_Load"
    '// call the procedure
    Call TestSub(strTest)
    '// display a message box containing the value of strTest
    Msgbox strTest
End Sub

'// TestSub procedure when passing ByVal
Sub TestSub(ByVal strString As String)
    strString = "Hello from TestSub"
    '// when control returns to Form_Load, no changes will have
    '// been made to strTest
End Sub

'// TestSub procedure when passing ByRef
Sub TestSub(ByRef strString As String)
    strString = "Hello from TestSub"
    '// when control returns to Form_Load, the value of
    '// strTest will have changed to Hello from TestSub
End Sub

Note that when you are passing a variable ByRef, it must be declared as a specific datatype (ie string). Otherwise, VB cannot pass a pointer to it. If you do not do this, you will get a compile error:

ByRef Argument Type Mismatch.

This does not occur when passing ByVal. For example, the code below will produce a compile error when you press Command1:

Private Function TestFunction(ByRef sString As String)
    sString = sString & vbCrLf
End Function

Private Sub Command1_Click()
    Dim sTestString
    TestFunction sTestString
End Sub

while, the code below would not, as you have explicitly declared sTestString As String.

Private Function TestFunction(ByRef sString As String)
    sString = sString & vbCrLf
End Function

Private Sub Command2_Click()
    Dim sTestString As String
    TestFunction sTestString
End Sub

Friday, May 16, 2008

Developers born Brave to handle any situation

Thursday, May 15, 2008

Bulk Insert Into SQL SERVER from CSV / text file

This is very common request recently - How to import CSV file into SQL Server? How to load CSV file into SQL Server Database Table? How to load comma delimited file into SQL Server? Let us see the solution in quick steps.



CSV stands for Comma Separated Values, sometimes also called Comma Delimited Values.



Create TestTable

USE TestData GO CREATE TABLE CSVTest
(ID INT,FirstName VARCHAR(40),LastName VARCHAR(40),BirthDate SMALLDATETIME) GO  

Create CSV file in drive C: with name csvtest.txt with following content. The location of the file is C:\csvtest.txt

1,James,Smith,19750101 2,Meggie,Smith,19790122 3,Robert,Smith,20071101 4,Alex,Smith,20040202





Now run following script to load all the data from CSV to database table. If there is any error in any row it will be not inserted but other rows will be inserted.

BULK INSERT CSVTest FROM ‘c:\csvtest.txt’ WITH(FIELDTERMINATOR = ‘,’,ROWTERMINATOR = ‘\n’) GO  

Check the content of the table.

SELECT *     FROM CSVTest GO  

Drop the table to clean up database.

SELECT *     FROM CSVTest GO  



Dotnet-Interviews