Sunday, February 13, 2011

Multiplication trick

To make the multiplication with some trick
12*13=?

Take first digit from each side
1*1=1

Then make cross multiple with other digit and sum the result

(1*3)+(1*2)=5

finally take multiple of last digit in both the side

2*3=6

now con cat all the result will give you the result

1+5+6


Similarly for little bit complex digit

56*98=?

(5*9)=45

(5*8)+(6*9)=94

(6*8)=48

Here while you join the result some time you can find more than one digit as in this case, if so you have to add the highest position of each result with other.

In our case, you have to combine 45 with 95, here 95 is two digit number and not single digit so add 9 it with 45 which result as below 54 now combine remaining one digit 4 with this 54.

544

similarly for last one
544+48=> 54(4+4)8=>5488

so the result is 56*98=5488

Thursday, February 3, 2011

Create identity to create table with data

Normally we can't create the identity in the existing column, it must be created while creating the table. Suppose if you have a data in the table you want to add the identity in the table, we can do it in indirect way as below.

Consider the table as table1 and it contain a column as column1

Now am rename the table1 as table1_new as below

sp_rename 'table1','table1_new'

Now create a new table as table1

create table table1(column1 int primary key identity(1,1))

then turn off identity

set identity_insert table1 on

Now copy all data from old table to new table as below

insert into table1(column1 )
select column1 from table1

Now turnon the identity

set identity_insert table1 off

Find the max value of column

select MAX(column1) from table1

Reseed the identity as below

DBCC CHECKIDENT (table1, RESEED, 220);

Now you can make use of the table along with identity as before

Custom Paging API

Normally in Win Application you have Paging option is available only for moving to Next or Previous record, and move to First or Last Record. Suppose if you want to set page wise navigation then you have to go for custom paging.

In codeplex you can find CustomPaging API this is an alpha release, they provide an set of inbuild methods for Record Navigation, and page navigation. You can make use this CustomPaging API to any Application both Windows or Web Application. You can download this CustomPaging API form here [Click Here To Download]

Class Description

Available Function in dsPaging

Properties

1) NumberOfRecordPerPage

Note:- This NumberOfRecordPerPage must be specify before you call any static method from below for paging at first time. This property hold how many number of records can disply per page.

Static Methods

1) List nextRow(int curentgridindex, int currentpage, int totalrowcount)

2) List previuosRow(int curentgridindex, int currentpage, int totalrowcount)

3) List nextPage(int curentgridindex, int currentpage, int totalrowcount)

4) List previousPage(int currentpage, int totalrowcount)

5) List LastRecord(int totalrowcount)

6) List FirstRecord()

7 ) List RefreshRow(int curentgridindex, int currentpage, int totalrowcount)

8 ) List GetPagePosition(int rowindex, int totalNumberofRow)

Note:-

Here curentgridindex:- Refer Current Select index of the grid

currentpage:- Current Page that is displayed on the grid

totalrowcount:- Total number of record that holds (Full row count and not per page row count)

rowindex:- Same as Currentgridindex.

Sample Code:

//Move to Next Row
private void NextRow_Click(object sender, EventArgs e)
{
int totalrowcount = ds.Tables[0].Rows.Count;
dsPaging.NumberOfRecordPerPage = Convert.ToInt32(textBox1.Text);
List poition = dsPaging.nextRow(currentindex, currentpage, totalrowcount);
currentindex = poition[0];
currentpage = poition[1];
Noofrow = poition[2];
ReFillGrid();
}

Any bug or Paging API question are always welcome.

22 Ways to Become Spectacularly Inspirational

1. Do important work vs. merely offering opinions.

2. Lift people up vs. tear others down.

3. Use the words of leadership vs. the language of victimhood.

4. Don’t worry about getting the credit for getting things done.

5. Become part of the solution rather than part of the problem.

6. Take your health to a level called superfit.

7. Commit to mastery of your craft instead of accepting mediocrity in your work.

8. Associate with people whose lives you want to be living.

9. Study for an hour a day. Double your learning and you’ll triple your success.

10. Run your own race. “No one can possibly achieve real and lasting success by being a conformist,” wrote billionaire J. Paul Getty

11. Do something small yet scary every single day.

12. Lead Without a Title.

13. Focus on people’s strengths vs. obsessing around their weaknesses.

14. Remember that potential unused turns into pain. So dedicate yourself to expressing your best.

15. Smile more.

16. Listen more.

17. Read the autobiography of Nelson Mandela.

18. Reflect on the words of Eleanor Roosevelt who said: “Great minds discuss ideas; Average minds discuss events; Small minds discuss people.”

19. Persist longer than the critics suggest you should.

20. Say “please” and “thank you”.

21. Love your loved ones.

22. Do work that matters.

Resource : RobinSharma

Monday, November 15, 2010

How to add new site collection in separate content database

http://blogs.msdn.com/b/mcsnoiwb/archive/2007/08/20/how-to-create-site-collection-in-a-specific-content-database.aspx

Thursday, November 11, 2010

How can i play multiple media files in moss2007

Am in the situation i need to run different media file(*.flv, *.wma, *.dat etc...) in my Sharepoint portal. Media player web part help me to achieve my goals. I download MediaPlayerWebpart.dll and i make use of it.

Small introduction about 'Media Player Web part'
The Media Player Web Part makes it easier to integrate media into SharePoint.It is a universal Media Player Web Part.It queries a media player HTML template from a SharePoint list located anywhere in your farm.Media-file URL, size, title, description, autoplay options can be set.

FAQ

Access

AspDotNetStorefront

BizTalk

BlogEngine.NET

Bug Reports and Suggestions for Microsoft

Cassini Web Server

Cat.Net (static code checker for SQL and XSS Injection)

Cheat Sheets

CkEditor

Classic ASP

Code Converters (convert VB to C# and C# to VB)

Cognos

Commerce Server

ComponentArt

Cross Browser Compliance

Cruise Control

Crystal Reports

CSS (Cascading Style Sheets)

C#

Delphi

Developer Express

Dojo

Doloto

Dot Less

Dot Net

DotnetNuke

Dreamwaver

Dundas Chart

Entity Framework

Expression Web

Facebook

FckEditor - see CKEditor

    FFMPEG

    Firebird

    Flash

    Foxpro

    Free Asp.Net Web Hosting

    FreeTextBox

    FXCOP

    F#

    Generic Programming Sites

    GhostDoc

    Git

    Googlemaps

    IIS and Classic Asp

    Infragistics

    Internet Explorer

    iTextSharp

    Java

    jQuery

    JSON

    LINQ

    LinqPad

    Live Meeting

    MBUnit

    Microsoft Charting Control

    Microsoft Infopath

    Microsoft Office

    Microsoft Project

    MOQ

    MySQL

    NANT Forum

    NHbernate

    NOPCommerce

    Notepad++

    Open Source Projects and Libraries

    Oracle

    Pex

    PHP

    Powershell

    Print XML

    Regular Expressions

    Sharepoint

    Sharpdevelop

    Siebel

    Silverlight

    Smart Devices

    Source Control (including Source Safe)

    SQL Compact/Mobile

    SQL Server:

    SQL Server Express

    SQL Server Setup and Getting Started

    SSAS

    SSIS

    SSRS

    StyleCop (a.k.a. CodeCop)

    SugarCRM

    SVN

    Sybase

    Terminal Services

    TinyMCE

    Telerik Controls

    Tortoise SVN

    Ultidev

    Umbraco

    Unity

    Upload Source Projects to

    VideoLAN

    Visual Basic

    Visual Studio Debugger

    Visual Studio Express Edition

    Visual Source Safe (VSS)

    Visual Studio Team System (VSTS)

    Visual Studio Team Version Database Version

    Visual Studio Extensibility

    Visual Studio and .NET Framework documentation

    VSTO Visual Studio Tools for Office

    Web Hosting:

    Windows 7

    Windows Azure Development

    Windows Communication Foundation (WCF)

    Windows Forms

    Windows Mobile

    Windows Presentation Form (WPF)

    Windows Server 2008

    Windows Services

    Windows SysInternals

    Windows Workflow

    Windsor Castle

    Yet Another Forum