Monday, 9 December 2013

Select nth row of a table in sql server

WITH myTableWithRows AS (
  SELECT (ROW_NUMBER() OVER (ORDER BY myTable.SomeField)) as row,*
  FROM myTable)
 SELECT * FROM myTableWithRows WHERE row = 3

where  myTable=your table name,
SomeField= your table column name,
row= name of internal primary key for run time only
myTableWithRows = self created table

Back Page

Monday, 25 November 2013

Code to view pdf in your HTML Page

<html>
    <body marginwidth="0" marginheight="0" style="background-color: rgb(38,38,38)">
       <embed width="100%" height="100%" name="plugin" src="[PDFfilepathhere].pdf" type="application/pdf">
    </body>
</html>

Monday, 11 November 2013

Google Map Integration on Your Website

Here the step of Google Map Integration on Your Website:
  1. Search your Address in Google Map
  2. Click on Link button
  3. Click on "Customize and preview embedded map" button
  4. Customize your Map According to your website
  5. Copy and paste given HTML to embed in your website

That's it... Your Map is Integrated into your Website

Friday, 25 October 2013

Host your project in IIS server as well as Intranet

Step by step process to host your site in IIS as well as Local Internet:


On IIS:
·         Run your project as Administrator in visual studio.
             Go to the property of you application

·       
             In Web tab select ‘Use Local IIS Web Server’

·         Give Project URL and Click on "Create Virtual Directory’ button
·        

 Now open Run (window+R) write ‘inetmgr’ to open your IIS Server


On Connections Refresh Default Web Site. Your Web Site is Present on here


·                          Browser your site.



             Copy your Site and Run Any Where into Local Intranet. That’s it.
   On Local Internet:
            for local internet just do given step....
‘Control Panel\All Control Panel Items\Windows Firewall\Allowed Programs’
And follow this step


Wednesday, 23 October 2013

Run your Project properly in Internet Explore


If Your Code is not running properly in Internet Explorer, then Write Some Script which is given by googlecode.com:

 <!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE6.js"></script>
<![endif]-->


that's it...

Tuesday, 22 October 2013

Custom validation with ASP.NET validator for max date and min date

Hello Friends,
you want to validate any text box as a minimum and maximum date, then use below code.

Step 1: A Custom Validator add in .aspx page

<asp:TextBox ID="txtDOJ" runat="server" PlaceHolder="Date of Journey"></asp:TextBox>
<asp:CustomValidator runat="server" ID="valDateRange" ControlToValidate="txtDOJ"
OnServerValidate="valDateRange_ServerValidate" ErrorMessage="enter valid date" />

Step 2: Code-behind .cs page

protected void valDateRange_ServerValidate(object source, ServerValidateEventArgs args)
        {
            DateTime minDate = DateTime.Parse(DateTime.Now.ToLongDateString());
            DateTime maxDate = DateTime.Parse(DateTime.Now.AddMonths(2).ToLongDateString());
            DateTime dt;

            args.IsValid = (DateTime.TryParse(args.Value, out dt)
                            && dt <= maxDate
                            && dt >= minDate);
        }


that's it...

Search on This Blog