Wednesday, December 18, 2024

Textbox Accepting Decimal Values

 

<asp:TextBox ID="TextBox1" runat="server" 
TextMode="Number" step="0.01" Width="140px" min="0"></asp:TextBox>

The request was aborted: Could not create SSL/TLS secure channel

 

// using System.Net;

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Use SecurityProtocolType.Ssl3 if needed for compatibility reasons
 
Note:
i.    Needed for .Net 4.5 because Tls12 is not a default protocol.
ii.   Need to write the above code only once within the application. (For example within 
      Global.asax > Application_Start within Web application or equivalent in Winforms application) 
iii.    For .Net 4.6 and above, Tls12 is a default protocol so it is not needed 

Saturday, December 7, 2024

Delete using INNER JOIN with SQL Server

Syntax

DELETE          TP
FROM            TransactionPayments TP
INNER JOIN      Transactions AS T ON T.TransactionID = TP.TransactionID
WHERE           CONVERT(DATE, T.TransactionDate) = '2024-12-07'