Globalizing Web Community Menu

Home
Mission
Message
Blog
Downloads
Favorite Links
Thanks
Invitation
Coty

     
Login or Register
Information Site

Back To Blog

Archive Links


August 18, 2006


February 25, 2006
February 8, 2006
January 15, 2006
November 16, 2005
October 31, 2005
October 1, 2005
September 20, 2005
September 3, 2005


   

5/2/2008

Visual Basics vs. C Sharp

I should like to continue on the important Basics syntax missing on C#.


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.

Comments: 0    Trackbacks: 0




Write a comment

TrackBack Address:
http://www.timeo.com/TrackBack.aspx?ID=113
   

RSS FEED