Click here to Skip to main content
15,889,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
foreach (ListEntry mySpread in myFeed.Entries)
          {
              DataRow myDR = myTable.NewRow();
              foreach (ListEntry.Custom listrow in mySpread.Elements)
              {
              DC = myTable.Columns[listrow.LocalName] ?? myTable.Columns.Add(listrow.LocalName);

                  myDR[DC] = listrow.Value;


              }
              myTable.Rows.Add(myDR);
          }

what ?? is used for ? and what is the purpose of ?? in this code??
Posted
Updated 31-Jan-14 5:15am
v2

The ?? has got nothing to do with ASP.NET, rather it's a C# operator. It returns the left-hand operand if the operand is not null; otherwise it returns the right hand operand.

More information can be found here[^]
 
Share this answer
 
Comments
Rahul VB 31-Jan-14 11:29am    
Thanks for enlightening Sir. Very nice
This is more about programming in C# than ASP.Net.
This is called the null coalesce operator - http://msdn.microsoft.com/en-us/library/1t3y8s4s.aspx[^].
 
Share this answer
 
Comments
Rahul VB 31-Jan-14 11:29am    
Thanks for enlightening Sir. Very nice
Its a very handy operator when it comes to work with Nullable Integer types and even on Reference Types.

Refer

Different Ways to Use Null Coalesce[^]
 
Share this answer
 
Comments
Rahul VB 31-Jan-14 11:29am    
Thanks for enlightening Sir. Very nice
JoCodes 31-Jan-14 11:31am    
You are always welcome. Happy learning :)
Rahul VB 31-Jan-14 11:35am    
Happy Learning:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900