Ok, I have an issue that I cannot seem to grasp. As per the title of the post, I am receiving a NullReferenceException when I access a stored procedure from a DataGridView in a C# application. The line of code that keeps throwing the exception is:
userName is coming from a class called variables. The call for that variable is:
public class Variables
public static string userName;
The ultimate conclusion to this task is to pass the userName variable to the stored procedure connected in the data adapter.
I have no idea what I am doing wrong. Following the debugger, I can see that the variable is being passed through correctly, but i have no idea why the NullReferenceException is being thrown.
Thank you for your time and any help is greatly appreciated.