Flicker Images

Find programmers and grapic design experts at ScriptLance.com

Thursday, September 27, 2012

How to Add Auto Number Column in Asp.net GridView

While working in ASP.NET, you often come across a need to display serial number or Auto-number in a Gridview control. This can be accomplished by adding the Container.DataItemIndex  in the html markup of the Gridview control.

<asp:TemplateField>
     <ItemTemplate>
 <%# Container.DataItemIndex + 1 %>
     </ItemTemplate>
 </asp:TemplateField>
Share:

SQL server Connecting from Another Computer

Configure SQL Server to listen on a specific port
  1. In SQL Server Configuration Manager, expand SQL Server Network Configuration, and then click on the server instance you want to configure.
  2. In the right pane, double-click TCP/IP.
  3. In the TCP/IP Properties dialog box, click the IP Addresses tab.
  4. In the TCP Port box of the IPAll section, type an available port number. For this tutorial, we will use 49172.
  5. Click OK to close the dialog box, and click OK to the warning that the service must be restarted.
  6. In the left pane, click SQL Server Services.
  7. In the right pane, right-click the instance of SQL Server, and then click Restart. When the Database Engine restarts, it will listen on port 49172.

To open a port in the Windows firewall for TCP access

Step 1
  1. On the Start menu, click Run, type WF.msc, and then click OK.
  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.
  3. In the Rule Type dialog box, select Port, and then click Next.
  4. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine. Type 1433 for the default instance. Type 49172 if you are configuring a named instance and configured a fixed port in the previous task. Click Next.
  5. In the Action dialog box, select Allow the connection, and then click Next.
  6. In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.
  7. In the Name dialog box, type a name and description for this rule, and then click Finish.


Setp 2:

  1. On the Start menu, click Control Panel.
  2. In Control Panel, click Network and Internet Connections, and then open Windows Firewall.
  3. In Windows Firewall, click the Exceptions tab, and then click Add Port.
  4. In the Add a Port dialog box, in the Name box, type SQL Server "instanceName".
  5. In the Port number box, type the port number of the Database Engine instance. Type 1433 for the default instance. Type 49172 if you are configuring a named instance and configured a fixed port in the previous task. Verify that TCP is selected, and then click OK.


Share:

Wednesday, September 26, 2012

Set date format in jquery ui datepicker


The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages.  You can customize the date format.
  1. d – day of month (single digit where applicable)
  2. dd – day of month (two digits)
  3.  o – day of the year (no leading zeros)
  4. oo – day of the year (three digit)
  5. m – month of year (single digit where applicable)
  6. mm – month of year (two digits)
  7.  y – year (two digits)
  8.  yy – year (four digits)
  9. D – short day name
  10.  DD – full day name
  11.  M – short month name
  12.  MM – long month name
  13.  '...' – any literal text string
  14.  @ - UNIX timestamp (milliseconds since 01/01/1970)
  15. ! – Windows ticks (100ns since 01/01/0001)


 (function(){
    var pickerOpts = {
       dateFormat:"d MM yy"
    };
    $("#date").datepicker(pickerOpts);
 });



predefined date formats for datepicker
The complete set of predefined date formats
Option value
Date format
$.datepicker.ATOM
"yy-mm-dd"
$.datepicker.COOKIE
"D, dd M y"
$.datepicker.ISO_8601
"yy-mm-dd"
$.datepicker.RFC_822
"D, d M y"
$.datepicker.RFC_850
"DD, dd-M-y"
$.datepicker.RFC_1036
"D, d M y"
$.datepicker.RFC_1123
"D, d M yy"
$.datepicker.RFC_2822
"D, d M yy"
$.datepicker.RSS
"D, d M y"
$.datepicker.TIMESTAMP
@ (UNIX timestamp)
$.datepicker.W3C
"yy-mm-dd"

Share:

Game Reviews

BTemplates.com

Powered by Blogger.

Search This Blog

Video Of Day

Find Us OIn Facebook

Blogroll

Contact

Tackle the Web with up to 5 new .COMs, $5.99 for the 1st year!

Advertisement