Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:59
MemberDotNetting11-Mar-12 6:59 
AnswerRe: combobox Pin
OriginalGriff11-Mar-12 5:12
mveOriginalGriff11-Mar-12 5:12 
GeneralRe: combobox Pin
Ravi Bhavnani11-Mar-12 5:14
professionalRavi Bhavnani11-Mar-12 5:14 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 5:21
mveOriginalGriff11-Mar-12 5:21 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 5:43
MemberDotNetting11-Mar-12 5:43 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 5:52
mveOriginalGriff11-Mar-12 5:52 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:03
MemberDotNetting11-Mar-12 6:03 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 6:14
mveOriginalGriff11-Mar-12 6:14 
Which means that either:
1) You missed the line saying:
C#
List<string> liste = new List<string>();
So liste is null.
2) There is no value in the row - which means that it has probably come from a database as DBNull and been translated as null.
Try an experiment:
C#
foreach (DataGridViewRow row in dgv1.Rows)
    {
    DataGridViewCell cell = row.Cells[0];
    if (cell != null)
        {
        object o = cell.Value;
        if (o != null)
            {
            liste.Add(o.ToString());
            }
        else
            {
            Message.Show("Null in cell.Value");
            }
        }
    else
        {
        MessageBox.Show("Null in cell");
        }
    }
Or look in the debugger and see which of them is null.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:19
MemberDotNetting11-Mar-12 6:19 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:25
MemberDotNetting11-Mar-12 6:25 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 6:47
mveOriginalGriff11-Mar-12 6:47 
GeneralRe: combobox Pin
MemberDotNetting11-Mar-12 6:50
MemberDotNetting11-Mar-12 6:50 
GeneralRe: combobox Pin
OriginalGriff11-Mar-12 6:54
mveOriginalGriff11-Mar-12 6:54 
QuestionSimeple Service Not Working Pin
AmbiguousName11-Mar-12 2:51
AmbiguousName11-Mar-12 2:51 
AnswerRe: Simeple Service Not Working Pin
PIEBALDconsult11-Mar-12 3:36
mvePIEBALDconsult11-Mar-12 3:36 
AnswerRe: Simeple Service Not Working Pin
AmbiguousName11-Mar-12 5:49
AmbiguousName11-Mar-12 5:49 
GeneralRe: Simeple Service Not Working Pin
Dave Kreskowiak11-Mar-12 10:20
mveDave Kreskowiak11-Mar-12 10:20 
QuestionHow to Format a string in c# Pin
Arunkumar.Koloth11-Mar-12 0:48
Arunkumar.Koloth11-Mar-12 0:48 
AnswerRe: How to Format a string in c# Pin
André Kraak11-Mar-12 0:55
André Kraak11-Mar-12 0:55 
GeneralRe: How to Format a string in c# Pin
ProEnggSoft11-Mar-12 2:54
ProEnggSoft11-Mar-12 2:54 
AnswerRe: How to Format a string in c# Pin
OriginalGriff11-Mar-12 1:43
mveOriginalGriff11-Mar-12 1:43 
GeneralRe: How to Format a string in c# Pin
Arunkumar.Koloth11-Mar-12 17:30
Arunkumar.Koloth11-Mar-12 17:30 
GeneralRe: How to Format a string in c# Pin
Marcus_212-Mar-12 5:28
Marcus_212-Mar-12 5:28 
GeneralRe: How to Format a string in c# Pin
Arunkumar.Koloth13-Mar-12 4:37
Arunkumar.Koloth13-Mar-12 4:37 
GeneralRe: How to Format a string in c# Pin
Marcus_213-Mar-12 5:43
Marcus_213-Mar-12 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.