here is my code that is giving me the error(just this section)
InitializeComponent();
String sqlString = "SELECT firstName, lastName FROM ClubMembers";
//database connections and commands
String stConn = App.getConnectionString();
DataTable data = App.getGenericData(sqlString);
//get data and put into list box
for(int i=0; i<data.Rows.Count; i++)
{
string d1 = data.Rows[i]["lastName"].ToString() + ", " + data.Rows[i]["firstName"].ToString();
listboxMembers.Items.Add(d1);
}
I am getting the error inside the for part...either the int i=0 or the i<data.rows.count....not sure exactly why though
the error is : Object reference not set to an instance of an object.
it is pointing to the i=0 but the next section is highlighted...so not sure exactly which is causing the error....help..