# How to Retrieve First name and Last name of Manager?

**URL:** <https://discuss.workflowgen.com/t/how-to-retrieve-first-name-and-last-name-of-manager/895>\
**Category:** Form Designer\
**Created:** [October 17, 2017, 5:45pm UTC](https://discuss.workflowgen.com/t/how-to-retrieve-first-name-and-last-name-of-manager/895 "2017-10-17T17:45:19Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [December 6, 2018, 7:49pm UTC](https://discuss.workflowgen.com/t/how-to-retrieve-first-name-and-last-name-of-manager/895/4 "2018-12-06T19:49:49Z")

</div>

Hi David,

You can use the following code as an example :

> ```
> string lastname;
> string firstname;
> string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MainDbSource"].ToString();
> string queryString = "SELECT [LASTNAME],[FIRSTNAME] FROM [USERS] WHERE USERNAME = '" + USERNAME + "'";
>   
> using(System.Data.SqlClient.SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection(connectionString))
> {
> System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand(queryString, sqlConnection);
> sqlConnection.Open();
> using (System.Data.SqlClient.SqlDataReader reader = command.ExecuteReader())
> {
> while (reader.Read()){
> lastname = reader.GetString(0);
> firstname = reader.GetString(0);
> }
> }
> }
> 
> ```

---

_[View the full topic](https://discuss.workflowgen.com/t/how-to-retrieve-first-name-and-last-name-of-manager/895)._
