How to use CLR function at SQL Server?

Creating a CLR function in SQL Server involves the following steps:
1. Define the function as a static method of a class in a language supported by the .NET Framework
2. Register the assembly in SQL Server by using the CREATE ASSEMBLY statement
3. Create the function that references the registered assembly by using the CREATE FUNCTION statement

1. a. Create a SQL Server Project using Visual Studio 2019 or Higher, Named the Project SQLExternalMethods
b. Create a Class MySQLFunctions
c. Add a static Method with SQL function Attribute
i.e.
namespace SQLExternalMethods
{
public static class MySQLFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString Test(string myString )
{
return myString .ToUpper();
}
}
}


2. a. Build the Above project and copy the SQLExternalMethods .dll to SQL server Installed Server.
b. Open SSMS and Register the assembly
CREATE ASSEMBLY SQLTitleCase
FROM 'C:\Program Files (x86)\LLM\ SQLExternalMethods .dll ';
GO


3. Now create a SQL function to use the c# methods
CREATE FUNCTION MyToUpper(@myString nvarchar(max)) RETURNS nvarchar(max)
EXTERNAL NAME SQLExternalMethods . MySQLFunctions .Test ;
GO

How to read DBF to Datatable

OleDbConnection oConn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Temp;Extended Properties=dBase III");
OleDbCommand command = new OleDbCommand("SELECT * FROM Test.DBF", oConn);
oConn.Open();
DataTable dt = new DataTable();
dt.Load(command.ExecuteReader());
oConn.Close();

ORA-28001: The password has expired

The password life of the applications as well as operating systems are limited. To enabling more security we are getting some alert in daily life that we need to chage our passwords regularly on fixed inerval.

If we don’t change before the applications limitation, it will expired.

The other day when I was opening SQL Developer, I got message popup “ORA-28001: The password has expired”.

To fix this issue we need to connect Oracle with SYSDBA OR SYSTEM user and do the following things.

STEP 1: Check the users status.

SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS;

USERNAME             ACCOUNT_STATUS
-----------------------------------------------
ANONYMOUS OPEN
SYSTEM OPEN
SYS OPEN
LMENARIA EXPIRED & LOCKED

STEP 2: Set the password of locked user.

ALTER USER LMENARIA IDENTIFIED BY pa55word;

STEP 3: Unlock the user account.

ALTER USER LMENARIA ACCOUNT UNLOCK;

STEP 4: Check the user status again is not locked anymore.

SELECT USERNAME,ACCOUNT_STATUS FROM DBA_USERS;

USERNAME                         ACCOUNT_STATUS
-----------------------------------------
ANONYMOUS OPEN
SYSTEM OPEN
SYS OPEN
LMENARIA OPEN