Click here to Skip to main content
14,846,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create ".eml" file using desktop application in .net to use it to send E-mail? Pin
User 66589-Jul-08 4:39
MemberUser 66589-Jul-08 4:39 
Questionhashtable within a hashtable Pin
benjamin yap9-Jul-08 4:02
Memberbenjamin yap9-Jul-08 4:02 
AnswerRe: hashtable within a hashtable Pin
Christian Graus9-Jul-08 4:07
protectorChristian Graus9-Jul-08 4:07 
GeneralRe: hashtable within a hashtable Pin
benjamin yap9-Jul-08 4:11
Memberbenjamin yap9-Jul-08 4:11 
GeneralRe: hashtable within a hashtable Pin
Christian Graus9-Jul-08 4:14
protectorChristian Graus9-Jul-08 4:14 
GeneralRe: hashtable within a hashtable Pin
User 66589-Jul-08 4:13
MemberUser 66589-Jul-08 4:13 
GeneralRe: hashtable within a hashtable Pin
Christian Graus9-Jul-08 4:15
protectorChristian Graus9-Jul-08 4:15 
AnswerRe: hashtable within a hashtable Pin
User 66589-Jul-08 4:10
MemberUser 66589-Jul-08 4:10 
benjamin yap wrote:
this is what i do, but i get

Object reference not set to an instance of an object.

on this line


This may have several reasons:

- order is null
- the returned Product may be null: You are checking ContainsKey with a string (Convert.ToString(p.ModelNumber)), but pass some other data type to the hashtable key (p.ModelNumber)

Try this:

foreach (Order order in orderTable.Values)
{
    string modelNumberStr = Convert.ToString(p.ModelNumber);
    if (order != null && order.ItemList.ContainsKey(modelNumberStr))
    {
        uint modelNum = ((Product)order.ItemList[modelNumberStr]).ModelNumber;
        string cellValue = modelNumberStr;
        if (cellValue == Convert.ToString(modelNum))
        {
            dataGridProduct.Rows[currentRow].Cells["colSelect"].Value = true;
        }
    }
}


regards

modified 12-Sep-18 21:01pm.

GeneralRe: hashtable within a hashtable Pin
benjamin yap9-Jul-08 4:31
Memberbenjamin yap9-Jul-08 4:31 
QuestionWindows Service accessing DMZ resources Pin
newc19-Jul-08 3:46
Membernewc19-Jul-08 3:46 
QuestionStop Timer Plz. Pin
Member 34356149-Jul-08 3:32
MemberMember 34356149-Jul-08 3:32 
AnswerRe: Stop Timer Plz. Pin
stancrm9-Jul-08 3:54
Memberstancrm9-Jul-08 3:54 
AnswerRe: Stop Timer Plz. Pin
Christian Graus9-Jul-08 3:56
protectorChristian Graus9-Jul-08 3:56 
AnswerRe: Stop Timer Plz. Pin
#realJSOP9-Jul-08 9:15
mva#realJSOP9-Jul-08 9:15 
Questionc# GUI for mapping two different databases Pin
sarmstrong039-Jul-08 3:05
Membersarmstrong039-Jul-08 3:05 
QuestionRedirecting to a new .aspx page Pin
WebMaster9-Jul-08 2:31
MemberWebMaster9-Jul-08 2:31 
AnswerRe: Redirecting to a new .aspx page Pin
leppie9-Jul-08 2:37
Memberleppie9-Jul-08 2:37 
AnswerRe: Redirecting to a new .aspx page Pin
ITS79-Jul-08 10:53
MemberITS79-Jul-08 10:53 
Questioniis pick up service Pin
shababnet9-Jul-08 2:26
Membershababnet9-Jul-08 2:26 
QuestionIndex was outside the bounds of the array Pin
NewToAspDotNet9-Jul-08 1:45
MemberNewToAspDotNet9-Jul-08 1:45 
AnswerRe: Index was outside the bounds of the array Pin
leppie9-Jul-08 1:48
Memberleppie9-Jul-08 1:48 
GeneralRe: Index was outside the bounds of the array Pin
NewToAspDotNet9-Jul-08 1:55
MemberNewToAspDotNet9-Jul-08 1:55 
AnswerRe: Index was outside the bounds of the array Pin
User 66589-Jul-08 1:53
MemberUser 66589-Jul-08 1:53 
QuestionIHTMLDOCUMENT2 AND SOURCECODE Pin
ITS79-Jul-08 1:44
MemberITS79-Jul-08 1:44 
AnswerRe: IHTMLDOCUMENT2 AND SOURCECODE Pin
leppie9-Jul-08 1:51
Memberleppie9-Jul-08 1:51 

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.