Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

GetUserDetails

Posted on February 21, 2013October 26, 2015 By David Kittell
public static string GetUserDetails(string stringInput, int displayoption)
          {
                if (stringInput == "")
                {
                    return strErrorMessage_GetUserDetails;
                }
                else
                {
                    string strUserName = "";
                    string strName = "";
                    string strReturnString = "";

                    string query1 = "SELECT user_name, first_name, last_name FROM users where user_id = '" + stringInput + "'";
                    //    strReturnString = "<p>" + query1 + "</p>";

                    using (SqlConnection conn1 = new SqlConnection(connString))
                    {
                        using (SqlCommand cmd1 = new SqlCommand(query1, conn1))
                        {
                            conn1.Open();
                            SqlDataReader rdr1 = cmd1.ExecuteReader();
                            if (rdr1.HasRows)
                            {
                                while (rdr1.Read())
                                {
                                    strUserName = rdr1["user_name"].ToString();
                                    strName = rdr1["first_name"].ToString() + " " + rdr1["last_name"].ToString();

                                    switch (displayoption)
                                    {
                                        case 1:
                                            strReturnString = strReturnString + strUserName;
                                            break;
                                        case 2:
                                            strReturnString = strReturnString + strName + " (" + strUserName + ")";
                                            break;
                                        default:
                                            strReturnString = strReturnString + strName + " (" + strUserName + " " + stringInput + ")";
                                            break;
                                    }
                                }
                            }
                        }
                    }
                    return strReturnString;
                }
Originally Posted on February 21, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

C# Ektron Code Ektron Ektron User Management

Post navigation

Previous post
Next post

Related Posts

Ektron – Remove Content/Folder Permissions

Posted on August 20, 2014October 26, 2015

Use EXTREME caution on this query. I recommend you do a backup of your database before you run this script as this will remove all permissions that someone has setup on Ektron. TRUNCATE TABLE [permissions_tbl]; UPDATE [content] SET [inherit_permissions] = 0 ,[inherit_permissions_from] = 0 ,[private] = 0; Originally Posted on…

Read More

Ubuntu – Squid Proxy Setup

Posted on January 18, 2016January 18, 2016

sudo apt-get –assume-yes remove –purge squid squid3 && sudo apt-get –assume-yes autoremove && rm -r /etc/squid && rm -r /etc/squid3 && rm -r /var/spool/squid sudo apt-get –assume-yes -f install squid3 cd /etc/squid3/ sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original sudo cat squid.conf.original | egrep -v -e ‘^[[:blank:]]*#|^$’ > squid.conf sudo chmod a-w /etc/squid3/squid.conf.original…

Read More

Windows Server – Enable TLS 1.2 Support

Posted on October 12, 2016

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes