Posts

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 ...

What is Magic table in SQL ?

Magic tables are nothing but INSERTED, DELETED table scope level, These are not physical tables, only Internal tables.  This Magic table are used In SQL Server 6.5, 7.0 & 2000 versions with Triggers only.  But, In SQL Server 2005, 2008 & 2008 R2 Versions can use these Magic tables with Triggers and Non-Triggers also.  Using with Triggers:   If you have implemented any trigger for any Tables then,  1.Whenever you Insert a record on that table, That record will be there on INSERTED Magic table.  2.Whenever you Update the record on that table, That existing record will be there on DELETED Magic table and modified New data with be there in INSERTED Magic table.  3.Whenever you Delete the record on that table, That record will be there on DELETED Magic table Only.  These magic table are used inside the Triggers for tracking the data transaction.  Using Non-Triggers:  You can also use the Magic tables with Non-Trigger activities using...