Hi,
This is the code.
vote.Open();
string query = "SELECT FullNames from CouncilorsSubVotes order by FullNames";
SqlCommand all = new SqlCommand(query, vote);
SqlDataReader reader = all.ExecuteReader();
reader.Read();
string ReadCouncilorsVotes = reader[0].ToString() + "";
if (ReadCouncilorsVotes == null)
{ }
reader.Read();
string ReadCouncilorsVotes1 = reader[0].ToString() + ""; <---------------------null(It jump, it can't continue read the other reader, i want that if one of the string is null it proceed to the next.)
if (ReadCouncilorsVotes1 == null)
{ }
reader.Read();
string ReadCouncilorsVotes2 = reader[0].ToString() + "";
if (ReadCouncilorsVotes2 == null)
{ }
reader.Read();
string ReadCouncilorsVotes3 = reader[0].ToString() + "";
if (ReadCouncilorsVotes3 == null)
{ }
reader.Read();
string ReadCouncilorsVotes4 = reader[0].ToString() + "";
if (ReadCouncilorsVotes4 == null)
{ }
reader.Read();
string ReadCouncilorsVotes5 = reader[0].ToString() + "";
if (ReadCouncilorsVotes5 == null)
{ }
reader.Read();
string ReadCouncilorsVotes6 = reader[0].ToString() + "";
if (ReadCouncilorsVotes6 == null)
{ }
reader.Read();
vote.Close();
I want that if one of the reader become null it proceed to the next reader...how to fix this problem?