SQL Server uses the following precedence order for data types:

1.user-defined data types (highest)
2.sql_varian t
3.xml
4.datetimeoffset
5.datetime2
6.datetime
7.smalldatetime
8.date
9.time
10.float
11.real
12.decimal
13.money
14.smallmoney
15.bigint
16.int
17.smallint
18.tinyint
19.bit
20.ntext
21.text
22.image
23.timestamp
24.uniqueidentifier
25.nvarchar (including nvarchar(max))
26.nchar
27.varchar (including varchar(max))
28.char
29.varbinary (including varbinary(max))
30.binary (lowest)

//To Check the given control contain only Alpha numeric values

function CheckKeyIsAlphanumerics(oControl)
{
if (/\W/.test(oControl.value))
{
alert("Please enter alphanumerics only");
oControl.value ="";
return false;
}
}

// Another way to validate this is

function CheckKeyIsAlphanumerics(oControl)
{
var regexNum = /\d/;
var regexLetter = /[a-zA-z]/;
if(!regexNum.test(oControl.value) !regexLetter.test(oControl.value))
{
alert('Type alphanumeric character');
return false;
}
}

//To Check the given control contain only Numeric Values

function CheckKeyIsNumerics(oControl)
{
if (/[^0-9]/.test(oControl.value))
{
alert("Please enter only numerics.");
oControl.value ="";
return false;
}
}

Windows offers the ability to save passwords for web sites and network resources. This can be very convenient as opposed to remembering and entering the username and password each time you need access, but it poses a security risk because anyone who has physical access to your computer would also be able to log into those sites using your saved credentials. In order to remove the saved password follow the steps below though you can access a graphical interface to add, remove or edit the saved passwords on a given system.

1. Click Start and select Run

2. It can be done in two ways: In the Open field type

a. "rundll32.exe keymgr.dll, KRShowKeyMgr"
b. "Control userpasswords2", in the opened dialog go to the "Advanced" tab and "Manage passwords".

3. Once the Stored Usernames and Passwords interface opens you can select any of the entries and select Properties to view the existing information

4. To remove a saved password you can select one of the entries and select Remove. A confirmation screen will appear. Click on OK and the account will be removed

5. You can add additional saved passwords as well by clicking on the Add button and entering the appropriate information

6. Repeat the steps above as needed to add, remove or edit saved passwords

7. When you are done using the interface click the Close button

Category : | Read More......

To add Datetime parameter select the Report in the top menu - > report parameters. Add a new parameter by clicking the add button. The parameter name is given in the Name section which is used in the query or stored procedures as parameter. the Datatype should be DateTime.



The prompt is the display name for the parameter in the report. Therefore it should given in the user understandable format irrespective to name.



Select Report parameter can be done by two methods.

1. By Creating the Dataset and use the From Query to populate the values.
2. By populating the values directly to the parameter thro Non-queried.

1. Create a Dataset and if the parameter value should be from Database means write a select query with the column name. If it is hard-coded text means write a select statement with that text and combine all the select statement with Union statement. Once the Dataset set is defined create a new parameter. Enter the name, Data type and Prompt. If the parameter output is multiple value means check the Multi-value checkbox.



If it is "From query" means select the Dataset for that input parameter and then fill the Value field and label field. the label field is the display field in the input parameter and the value field is used for internal process.





2. If it is Non-Query means the Value field and Label field are entered directly and those values are displayed in the input parameter.

If there is default value for the input parameter enter those thro two methods. By default Null is selected means there is no default value. If the value is hard-coded means select Non-queried and enter the default text. If the value has to be retrieved from the Database means use Queried statement and select the Dataset and the value field. the top column of the result set is the default value for that column.

Once the parameter values are defined clearly check the report.



If the parameter value is not mandatory or it should allow null values means select the appropriate checkboxes in the input parameters.

Category : | Read More......

To Start the Reporting service -> Start - > All programs - > Microsoft Sql server 2005 - > Sql server Business Intelligence Development Studio.



Create a New Project



As Report server project



Once the project is created, Reports and Shared Data sources folder are created by default. The Shared Data sources will act as a Data source for the report and the report contains the rdl files.



In order to connect the database and the reporting service the data source is used. To create the data source right-click on the Shared Data Sources and click “Add New Data Source”.



Shared Data source Window will pop-up asking the user to fill the Data source information. To add that Press the Edit button.



Enter the Server name if it is from other PC, otherwise enter ‘.’ To represent the same PC Database and provided the Sql server authentication and based on the Server Name it displays the Database information. Select the Database that is going to be used for the reports. After that press the “Test Connection” button to make sure the connection is established properly.



Once the connection is created the Data source Name is displayed under the “Shared Data Sources”.



To add Report – Right-click on the Reports -> Add - > New Item



A pop-up will appear and asking the user for the Report Name.



Once the “Add” Button is pressed the created Report is displayed under the “Reports” in the Solution Explorer.



Create the Dataset for the Data source to display the report



On clicking the New Dataset link a pop-up will appear asking the user whether the dataset is going to be a inline-query or stored procedure. If it is stored procedure give the Execute statement of the stored procedure with the parameter name. If it is Inline query write the query inside the Query string.



In this example I am writing an Inline Query as “select * from temp2 where empno > @Empno”. To add the Report Parameter , Menu – Report – Report parameters





By Default the Empno is added in the report parameter, if more needs to added it can be added thro this method or adding the condition with parameter in the inline query. Thro Inline query again I add a parameter thro the design mode as “Sal”. Now the query is modified as “select * from temp2 where empno > @Empno and sal > @Sal” The selected columns are displayed in the Dataset. Now to display the report drag a table from the tool box and drop it in the Layout, since it retrieves more than one value. By default the table is created with the Header, Detailed and Footer row. If need any row can be added on right clicking the row and press the “Insert above” or “insert below” button. Then Drag and drop the Dataset values in the Table in the detailed row. To view the report press the preview button next to the layout tab.





Enter some values in the empno and sal textboxes and press the “View Report” button. It displays the report based on the applied filter. We can able to export the report in the required format.

Category : | Read More......

Array :

1. Char[] vowel=new Char[];
2. Array is in the System namespace
3. The capacity of an Array is fixed
4. An Array is a collection of similar items
5. An Array can have multiple dimensions
6. once you delete the item in array it kept that one as empty like a[2]=""

Array List :

1. ArrayList a_list=new ArrayList();
2. ArrayList is in the System.Collections namespace.
3. ArrayList can increase and decrease size dynamically
4. ArrayList can hold item of different types
5. ArrayList always has exactly one dimension
6. once you delete the item in arraylist a[3]index occupies the position of a[2] and also if you try to insert a[2] value array will throw error if any items reside inside but in case of arraylist a[2] is inserted in same position but at the same time position of a[2] become a[3] if there is already an item exists

Category : | Read More......

String.Format("{0:g}", DateTime.Now);

This outputs the current date and time in the following format: 8/05/2007 11:13 AM

Formats Include

{0:d} : 8/21/2007 (short date)
{0:D} : Tuesday, 21 August 2007 (long Date)
{0:f} : Tuesday, 21 August 2007 11:13 AM (full short)
{0:F} : Tuesday, 21 August 2007 11:13:17 AM (Full long)
{0:g} : 21/08/2007 11:13 AM (general)
{0:G} : 21/08/2007 11:13:17 AM (General long)
{0:m} : 21 August (month day)
{0:o} : 2007-08-21T11:13:17.4687500+10:00 (round trip)
{0:R} : Tue, 21 August 2007 11:13:17 GMT (RFC1123 pattern)
{0:s} : 2007-08-21T11:13:17 (sortable)
{0:t} : 11:13 AM (short time)
{0:T} : 11:13:17 AM (long Time)
{0:u} : 2007-08-21 11:13:17Z (universal)
{0:U} : Tuesday, 21 August 2007 1:13:17 AM (Universal GMT)
{0:Y} : August 2007 (Year month)



{0:dd} - 06 (day)
{0:ddd} - Sat (day abbr)
{0:dddd} - Saturday (day full)
{0:fff} - 692 (second fraction)
{0:gg} - A.D. (era)
{0:hh} - 07 (12 hour)
{0:HH} - 19 (24 hour)
{0:mm} - 21 (minute)
{0:MM} - 01 (month)
{0:MMM} - Jan (month abbr)
{0:MMMM} - January (month full)
{0:ss} - 29 (seconds)
{0:tt} - PM (am/pm)
{0:yy} - 07 (year)
{0:yyyy} -2007 (year full)
{0:zz} -08 (timezone)
{0:zzz} -08:00 (timezone full)
{0:hh:mm:ss} -7:21:29 (separators)
{0:MM/dd/yyyy} -1/06/2007 (separators)

Category : | Read More......

Let’s take a moment to investigate the differences between the two project models.

■ Web Site projects are special cases. They do not behave like any other project type in Visual Studio.

■ Web Application projects have a project file. Web Site projects do not.

■ Web Application projects compile into one monolithic assembly DLL; to run and debug pages, the entire project must be compiled every time. Web Site projects
compile dynamically at the page level; each page can be compiled and debugged
independently.

■ The Express editions of Visual Studio do not support the Web Application project type. So if you're using Visual Web Developer Express Edition or planning to share code with developers who only have access to this tool, you should use Web Site projects.

■ For small, Demonstration projects, the Web Site model is often more appropriate than a full-blown Web application. If your project is simple, choose the simple Web site project type.

■ Web Application projects are deployed “all at once,” as a single DLL, along with necessary static content files. Web Site projects are deployed as a set of files, each of which can be updated independently.

Each project type has its strengths and weaknesses, and Visual Studio 2005 will continue to fully support both project types, so either is a valid choice.

Category : | Read More......