I have created a function to get a userID from a user logging in, which fills a datatable and then I get the UserID from the first row of the datatable.
public int GetUserID (DataTable UserIDTable)
{
int UserID = Convert.ToInt32(UserIDTable.Rows[0]["USER_ID"]);
return UserID;
}
I then called the function in another form to get the userID from the datatable once the login button is hit.
int UserID = LoginFunction.GetUserID(DataTable);
I then need to use this UserID to display data in a grid for that user, but I'm not sure how to get the UserID from the form with the login button to the form with the grid.