Recordset lecture du contenu d'une colonne
Salut,
j'essaye de lire le contenu d'une colonne d'un tablaux et d'afficher tous les elements de cette colonne dans une ListBox. Mais je coince
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Command Cmd = ((Command)_Conn.Command);
Cmd.CommandText = "select unique RQ_user_08 from req where RQ_Father_id in (select RQ_REQ_ID from req where Rq_father_id in ( select RQ_REQ_ID from req where RQ_REQ_NAME = 'Requirements' ) and Rq_req_name = 'Requests')";
Recordset reqRs = (Recordset)Cmd.Execute();
if (reqRs.ColCount > 0)
while (!reqRs.EOR)
{
if (!(AvailableBaselineList.Items.Contains(reqRs[0].ToString()))) //Checking if Requirement already exist in Combobox
{
AvailableBaselineList.Items.Add(reqRs[0].ToString());
}
reqRs.Next();
} |
L'exception apparaît sur cette ligne:
Code:
if (!(AvailableBaselineList.Items.Contains(reqRs[0].ToString()))) //Checking if Requirement already exist in Combobox
Le probleme doit être "reqRs[0]"
Citation:
Exception : "System.NullReferenceException: Object reference not set to an instance of an Object."