Assuming you have everything wired up correctly with your project reference to the dll and a using statement in your code file.
BugReports reader = new BugReports();
That line only gets an instance of your BugReports
class, in order to make it do some work you need to call your method.
reader.userRoleDropDown();
I'm not sure why you are returning the SqlDataReader reader
that you've already closed, it is no longer any use. Also you are selecting data by calling reader = userRoleComm.ExecuteReader();
but all the work is commented out, not sure if that is intentional.
Edit:
You may be better off using a SQLDataAdapter since your UI controls won't be visible to your class, and you can't access the data in the SQLDataReader after it's closed.
public DataSet userRoleDropDown()
{
string connectionSrting = ConfigurationManager.ConnectionStrings["BugReports"].ConnectionString;
string queryString = "SELECT UserRoleID, UserRoleName FROM userRoles";
using (SqlConnection connection = new SqlConnection(connectionSrting))
{
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand( queryString, connection);
adapter.Fill(dataset);
return dataset;
}
}
Then you can do what ever you like with the selected data from your application.
More info on the important classes used here: SqlDataAdapter DataSet