I searched already & it isn't the issue to read Dataset , The issue is i done same but it is not working
I Am trying to get complete name from Datasset, when i try following
String Receiver_name = rec_Ds.Tables[0].Rows[0][First_Name].ToString() + " " + rec_Ds.Tables[0].Rows[0][Last_Name].ToString();
it gives ArgumentNullException was unHandeled
With sub Message of 'name' argument cannot be null.
so I searched over internet & changed Code to
String Receiver_name = rec_Ds.Tables[0].Rows[0][“First_Nameˮ].ToString() + “ ˮ + rec_Ds.Tables[0].Rows[0][“Last_Nameˮ].ToString();
now it gives “First_Nameˮ Doesn't exist in content
I tried get it working by following , It doesn't seems any difference ( in above and below code) to me in any kind but it works perfectly
My question is Why this work while above doesn't worked, And why above code doesn't work
String Receiver_name = rec_Ds.Tables[0].Rows[0]["First_Name"].ToString();
Receiver_Name+= " " + rec_Ds.Tables[0].Rows[0]["Last_Name"].ToString();
Well,
“First_Nameˮ
is treated as a variable name and not as a quoted string, as the quotes are not "normal" double quotes, but typographical left/right quotes, so they are threated as unicode signs.Change them to normal double quotes.
So: Be careful when copy&pasting from the internet - make sure the quotes are actually recognised as quotes and check the syntax highlighting.