Posts

Visual Studio 2008, 2010, 2011, 2012 Keyboard Shortcuts Keys

It is amazing that you can get around without using a mouse at all. Master the following Visual Studio shortcuts and your colleagues might stare at you with amazement. 1.    F5: Start your project in debug mode 2.    F7 & Shift-F7: Show the code windows & Show the designer window 3.    Alt-Enter: Show the properties panel for a selected object (this is general Windows shortcut that can be used on files and directories) 4.    F6 / Shift-F6 / Ctrl-Shift-B: Build solution / Build project / Build solution 5.    Shift-Alt-C: Add a new class to your project 6.    Ctrl-K + Ctrl-C: Comment a selected block of code 7.    Ctrl-K + Ctrl-U: Un-comment a selected block of code 8.    Ctrl-M + Ctrl-O / Ctrl-M + Ctrl-P: Collapse all code to definitions / Expand all code (stop collapsing) 9.    Ctrl-M + Ctrl+M: Expend or collapse a selected code fragment. T...

What is a trusted connection?

Net-Lib (The Microsoft SQL Server Network Library) is also able to support the impersonation of a logged in user's security context for protocols that support authenticated connections (called trusted connections). This allows Net-Lib to provide an integrated logon authentication mechanism via the use of Windows Authentication. Windows Authentication is not supported on Windows 98 or Windows Me.

how to subtract value at previous row from current row?

Table data is like....  ------------------------------ EmpID    Emp_Name    Salary ------------------------------- 1             Mark             4000 2             Twin              2000 3             Aleganja        3000 4             Peter             8000 ------------------------------- Method (1) ------------------------------------ -  select top 1 EmpID,SALARY from Employee  union  SELECT e1.EmpID,(e2.Salary - e1.Salary) AS SALARY FROM Employee e1  INNER JOIN ...

End Date should not be less than Start Date using jQuery Date Picker

set maxDate: '0d' if you want to set your range with current date. $(document).ready(function(){ $("#txtFromDate").datepicker({ maxDate: '0d', numberOfMonths: 2, onSelect: function(selected) { $("#txtToDate").datepicker("option","minDate", selected) } }); $("#txtToDate").datepicker({  maxDate: '0d', numberOfMonths: 2, onSelect: function(selected) { $("#txtFromDate").datepicker("option","maxDate", selected) } }); });

How can I get column names from a table in sql server?

SELECT [name] FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE type = 'U' AND [Name] = 'Your Table Name')

C# Remove HTML/XML Tags

Removing HTML tags from strings Input: <p>The <b>dog</b> is <i>cute</i>.</p> Output: The dog is cute. Performance test for HTML removal HtmlRemoval.StripTagsRegex: 2404 ms HtmlRemoval.StripTagsRegexCompiled: 1366 ms HtmlRemoval.StripTagsCharArray: 287 ms [fastest] File length test for HTML removal File tested: Real-world HTML file File length before: 8085 chars HtmlRemoval.StripTagsRegex: 4382 chars HtmlRemoval.StripTagsRegexCompiled: 4382 chars HtmlRemoval.StripTagsCharArray: 4382 chars HtmlRemoval static class [C#] using System; using System.Text.RegularExpressions; /// <summary> /// Methods to remove HTML from strings. /// </summary> public static class HtmlRemoval { /// <summary> /// Remove HTML from string with Regex. /// </summary> public static string StripTagsRegex(string source) { return Regex.Replace(so...

Working with Power Builder Data Window

1) create a custom object with  n_Connection  name and class with  GetConn and   return as transcation data type... // Profile myprofile Transaction trans SQLCA.DBMS = "SNC SQL Native Client(OLE DB)" SQLCA.LogPass = "**************" SQLCA.ServerName = "000.000.000.000" SQLCA.LogId = "User ID" SQLCA.AutoCommit = False SQLCA.DBParm = "Database='Database Name',Provider='SQLNCLI10',TrustedConnection=1" connect using sqlca; trans=sqlca return trans 2) Bind Data window... n_Connection obj obj = create n_Connection Transaction tran tran  = create Transaction tran=obj.GetConn() connect using tran; datawindow .SetTransObject(tran) datawindow .Retrieve() disconnect using tran; 3) Update record after change data in grid itself... n_Connection obj obj = create n_Connection Transaction tran tran  = create Transaction tran=obj.GetConn() connect using tran; datawindow.SetTransObject(tran) datawindow ...