Thursday, July 24, 2008

Missing or No Security Tab Found in Windows XP Professional.

Security tab for the properties of files or folders in Windows XP Professional is the important functionality that enable administrators and users to define security permissions and rights for particular user or group to the computer resources. By default, Windows XP Professional follows recommended setting to enable the use of simple file sharing that hide the Security tab, leaving you with only General, Sharing, Web Sharing & Customize tabs as in the Simple File Sharing UI.

So to see and unhide the Security tab, just use the following steps:

Launch Windows Explorer or My Computer.
Click on the Tools at the menu bar, then click on Folder Options.
Click on View tab.
In the Advanced Settings section at the bottom of the list, uncheck and unselect (clear the tick) on the “Use simple file sharing (Recommended)” check box.
Click OK.
Security tab is available only to Administrator or users with administrative rights. So make sure you login as one. And security can only be set in an NTFS partition. If you’re still having problem to reveal or display the Security tab on files or folder properties, check out the following registry hack and set the value to 0 or simply delete the key:

Hive: HKEY_CURRENT_USER
Key: Software\Microsoft\windows\CurrentVersion\Policies\Explorer
Name: Nosecuritytab
Type: REG_DWORD
Value: 1

If you’re using a Windows XP Professional system that is installed in a Workgroup, the Security tab is also hidden by default because in Windows XP Home Edition and Windows XP Professional, guests are forced to log on to a workgroup. Follow the instruction and information on Microsoft Knowledge Base where you need to set the value for ForceGuest registry key.

How to enable the security tab in folder properties for Windows XP.

follow the given bellow steps to find security tab in folder properties.
1.go to run promt
2.type gpedit.msc
3.group policy window will open
4.in that window u can see computer configuration
5.under that option u can see windows settings.
6.click that option and click security settings.
7.now u can see one folder in the name of
local policies .click that option
8.now u can see security option . click that.
9.now u can see more options in one window.
10. now press "N" and search where is
NETWORK ACCESS: SHARING AND SECURITY FOR LOCAL ACCOUNTS option.
11.click that option. and new window will pop up
12.in that window u can see one drop down box.
now u should select classic: local users
authendicate as themselves.

now close all the windows .open one folder select properties . now u can see security tab...

Thursday, July 3, 2008

64-bit OLEDB Provider for ODBC (MSDASQL) Available in Longhorn Server, Starting Beta 3

We’re pleased to announce that Longhorn Server Beta 3 will include a 64-bit version of MSDASQL, Microsoft’s OLEDB Provider for ODBC.

What is MSDASQL?

MSDASQL is an OLEDB provider that allows applications built on OLEDB and ADO (which uses OLEDB internally) to access data sources through an ODBC driver instead of a database. MSDASQL ships with the Windows Operating System, and Longhorn Beta 3 is the first Windows release to include a 64-bit version of MSDASQL.

Who does this impact?

If you are a customer in one of the following scenarios, you will see direct benefits from this technology when upgrading to or deploying Longhorn Server:

·SQL Server Customers with Heterogeneous DBMS Environments: the Linked Server and Distributed Query features of SQL Server connect to external data sources through an OLEDB provider. The addition of the 64-bit MSDASQL Provider allows these features to leverage the 64-bit equivalents of ODBC drivers that SQL Server applications of 32-bit environments are already using, and to use an ODBC 64-bit driver if a 64-bit OLEDB provider for the target external data source is not available.

·ADO and ASP Customers Planning a Migration to 64-bit: on 32-bit operating systems, MSDASQL is the default OLEDB provider used by ADO. In Longhorn Server Beta 3, applications that specify an ODBC driver in the connection string (e.g. “Driver={SQL Server}...”) are not required to change connection strings when migrating to 64-bit.

·Customers with OLEDB Applications Using ODBC Data Sources: when migrating these applications to 64-bit, the applications can leverage a native 64-bit ODBC driver, provided that one is available for the target data source.

Isn’t MSDASQL Deprecated?

Previous messaging on MSDN indicated that a 64-bit version of MSDASQL would not be available. However, we have received numerous requests from customers for this technology and we are making it available to address the pain experienced in the scenarios described above without 64-bit MSDASQL.

To get MSDASQL.dll please click Download

Monday, June 23, 2008

Select top n random rows from a table in SQL SERVER...

There are many ways that you can use randomly selected rows; they're especially effective when you want to add dynamism to a site. For instance, you could randomly select a product to present as Today's Featured Product, or QA could generate a random call list to gauge customer satisfaction levels.

The snag is that SQL doesn't permit the selection of random rows. The good news is that there's a simple trick to getting this functionality to work in SQL.

The solution is based on the uniqueidentifierdata type. Unique identifiers, which are also called Guaranteed Unique Identifiers (GUIDs), look something like this:

4C34AA46-2A5A-4F8C-897F-02354728C7B0

SQL Server uses GUIDs in many contexts, perhaps most notably in replication. You can use them when normal incrementing identity columns won't provide a sufficient range of keys. To do this, you create a column of type uniqueidentifierwhose default value is NewID(), like this:

CREATE TABLE MyNewTable
(
PK uniqueidentifier NOT NULL DEFAULT NewID(),
AnotherColumn varchar(50) NOT NULL
,

. . .

This function is just the ticket to solve our random rows problem. We can simply call NewID() as a virtual column in our query, like this:


select top 4 Column_Name,NEWID() AS RANDOM from TABLE order by RANDOM

Friday, June 13, 2008

Random Number Generator...

There are many methods to generate random number in SQL Server.

Method 1 : Generate Random Numbers (Int) between Rang

-- Create the variables for the random number generation
DECLARE @Random INT;
DECLARE @Upper INT;
DECLARE @Lower INT

-- This will create a random number between 1 and 999
SET @Lower = 1 -- The lowest random number
SET @Upper = 999 -- The highest random number
SELECT @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0)
SELECT @Random
Method 2 : Generate Random Float Numbers

SELECT RAND( (DATEPART(mm, GETDATE()) * 100000 )
+ (DATEPART(ss, GETDATE()) * 1000 )
+ DATEPART(ms, GETDATE()) )
Method 3 : Random Numbers Quick Scripts

-- random float from 0 up to 20 - [0, 20)
SELECT 20*RAND()
-- random float from 10 up to 30 - [10, 30)
SELECT 10 + (30-10)*RAND()
--random integer BETWEEN 0
AND 20 - [0, 20]
SELECT CONVERT(INT, (20+1)*RAND())
--random integer BETWEEN 10
AND 30 - [10, 30]
SELECT 10 + CONVERT(INT, (30-10+1)*RAND())Method 4 : Random Numbers (Float, Int) Tables Based with Time

DECLARE @t TABLE( randnum float )
DECLARE @cnt INT; SET @cnt = 0
WHILE @cnt <=10000
BEGIN
SET @cnt = @cnt + 1
INSERT INTO @t
SELECT RAND( (DATEPART(mm, GETDATE()) * 100000 )
+ (DATEPART(ss, GETDATE()) * 1000 )
+ DATEPART(ms, GETDATE()) )
END
SELECT randnum, COUNT(*)
FROM @t
GROUP BY randnum
Method 5 : Random number on a per row basis

-- The distribution is pretty good however there are the occasional peaks.
-- If you want to change the range of values just change the 1000 to the maximum value you want.
-- Use this as the source of a report server report and chart the results to see the distribution
SELECT randomNumber, COUNT(1) countOfRandomNumber
FROM (
SELECT ABS(CAST(NEWID() AS binary(6)) %1000) + 1 randomNumber
FROM sysobjects) sample
GROUP BY randomNumber
ORDER BY randomNumber

Friday, May 30, 2008

C# InterView Questions....

  • What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
  • Can you store multiple data types in System.Array? No.

  • What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow.

  • How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods.

  • What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable.


  • What’s class SortedList underneath? A sorted HashTable.

  • Will finally block get executed if the exception had not occurred? Yes.

  • What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception? A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

  • Can multiple catch blocks be executed? No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.

  • Why is it a bad idea to throw your own exceptions? Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.


  • What’s a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.

  • What’s a multicast delegate? It’s a delegate that points to and eventually fires off several methods.

  • How’s the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.

  • What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command.

  • What’s a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.

  • What namespaces are necessary to create a localized application? System.Globalization, System.Resources.


  • What’s the difference between // comments, /* */ comments and /// comments? Single-line, multi-line and XML documentation comments.

  • How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch.

  • What’s the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example.

  • Is XML case-sensitive? Yes, so <Student> and <student> are different elements.


  • What debugging tools come with the .NET SDK? CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.

  • What does the This window show in the debugger? It points to the object that’s pointed to by this reference. Object’s instance data is shown.

  • What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.

  • What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.

  • Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.

  • Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.


  • How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.

  • What are three test cases you should go through in unit testing? Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).

  • Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.

  • Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).

  • What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.

  • What’s the role of the DataReader class in ADO.NET connections? It returns a read-only dataset from the data source when the command is executed.


  • What is the wildcard character in SQL? Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.

  • Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after).

  • What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).

  • Which one is trusted and which one is untrusted? Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.

  • Why would you use untrusted verificaion? Web Services might use it, as well as non-Windows applications.

  • What does the parameter Initial Catalog define inside Connection String? The database name to connect to.


  • What’s the data provider name to connect to Access database? Microsoft.Access.

  • What does Dispose method do with the connection object? Deletes it from the memory.

  • What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.
  • Read C# in more descriptive and easy way

    1: Introduction to C# , 2: Introduction to Variables , 3: Using Variables , 4: Introduction to Classes , 5: C# and Code Organization , 6: Data Reading/Formatting , 7: The Methods of a Class , 8: Combinations ofClasses , 9: Introduction to Conditions , 10:Conditional Statements , 11:Conditional Switches , 12:Counting and Looping , 13:The Properties of a Class , 14: Inheritance , 15:Polymorphism/Abstraction , 16:Delegates , 17:Structures , 18: Built-In Classes , 19: Introduction to Exceptions , 20: Using Exceptions , 21: Introduction to Arrays , 22: Arrays and Classes , 23: Multidimensional Arrays , 24: The Array Class , 25: Strings , 26: Introduction to Indexers , 27: Classes and Indexers , 28: Introduction to Collections , 29: Iterating a Collection , 30: Intro to Collection Classes , 31: Generics , 32: Intro to File Processing , 33: Details on File Processing , 34: Files Operations , 35: Serialization , 36: Querying a List

    Split the String values with a special character in MS Flow to convert this into Array

     Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...