Inside your SQL CLR C# code, you should not build a connection with explicit server, database name and credentials -instead, use the "context" connnectino:
using (SqlConnection conn = new SqlConnection("context connection=true"))
{
// do your stuff here...
}