The second one that I encountered is the following smart schema of Basics, using SQL Data Reader to efficiently retrieve the data: (Converted into C# format)
public ArticleInfo(SqlDataReader dr) : base(dr)
if (! Information.IsDBNull(dr["Article_Article"]))
_bodyText = dr["Article_Article"].ToString();
When I called on this constructor as follows: (Converted into C# fromat)
SqlDataReader objDataReader;
ArticleInfo objArticle = new ArticleInfo(objDataReader);
The C# compiler complained that I am using Data Reader as a variable and did not work. Therefore, I had to revert back to the less efficient method of using the DataSet/DataAdapter and DataRows.
The third example: When I returned the result by string using Try and Catch systax, as I wanted to also retrieve the SQL Exception message in case of failure, and display the result as follows:
string ReturnMessage;
if (ReturnMessage == 2)
Label.text = “Success”;
Else
Label.Text = ReturnMessage;
The C# compiler complained that the string or char cannot be used with this operator.