For example, if the Learning Record of the above nothing member is blank, you can judge it in the program as follows:
Private Static void processing NULL data () {Member Data tableadapter adapter = new member data tableadapter (); strong type data set. member data. member Data able DATA = adapter. getdata (); If (data [1]. is Learning Record null () {console. writeline ("Empty Learning Record");} else {console. writeline ("Learning Record: {0}", data [1]. learning records );}}
After a typed dataset is generated, all fields that can be null (which is related to the definition in the database) have a null value judgment method:
Then I want to display the Learning Record of the first record, and modified the source program.
Private Static void processing NULL data () {Member Data tableadapter adapter = new member data tableadapter (); strong type data set. member data. member Data able DATA = adapter. getdata (); If (data [0]. is Learning Record null () {console. writeline ("Empty Learning Record");} else {console. writeline ("Learning Record: {0}", data [1]. learning records );}}
Error:
What went wrong?