C# or VB, LINQ to SQL and Gridview Controls

Which is better C# or VB? I’m just curious why a lot of companies prefer C# to VB.

I first worked with B.A.S.I.C over 40 years ago at school. So learning Visual Basic and VB.Net was fairly easy. These days I prefer C#.  Also, as a Microsoft trainer and consultant my clients more often request that I work in C#.

I like C#’s concise syntax. It was designed for OOP. But the fact that it is so case sensitive can be a hassle. In .Net of course the language is less relevant.  Applications rely more on the  framework class libraries. All languages execute at approximately the same speed as they are first compiled to Intermediate Language.

Here is our tutorial on new features in C#.
http://talk-it.biz/c-3-0-features-visual-studio-2008

As a .NET Professional, what is your preferred flavor of .NET?

Developers and managers face a vast range of options today. Technologies are  rapidly  evolving.  We frequently have to evaluate and select new technologies. I am currently researching at MVC as a alternative to Webforms for ASP.Net web development.

When evaluating a new technology here are the questions to ask:

  • What am I familiar with?
  • What are the benefits of the new technology?
  • How long will it take me to become competent?
  • What resources can I use to learn the new technology?
  • How well the new technology integrate with existing technologies?

Click here is our tutorial on ASP.Net web development in C#.

What is gridview? Please tell me exact definition I am a beginner.

The gridview control displays data, like a spreadsheet, in rows and columns. It can easily bind to data e.g. a database table.  With Net 2.0 the datasource control was introduced. This provides a simple Wizard to bind to a database with it’s tables & columns. The datasource control  also provides automatic sorting, paging, updating and deleting in the gridview.

Alternatively the gridview can manually bind to an object e.g. a dataset. You then have to write event handler code for sorting, paging, updating and deleting.

The gridview also allows more advanced features,  like showing data hierarchically as parent and child rows. Or including extra controls, e.g.  adding checkboxes in a column.

Click here for our tutorial on data access in C#.

What do you prefer LINQ to SQL or Entity Framework as data layer?

My preference  between LINQ to SQL & The Entity Framework depends on the scenario. With LINQ to SQL you can access only a SQL Server database.
It allows you to drag tables, views and stored procedures to a O/RM design surface. LINQ to SQL automatically creates the classes and collections for you. You can then run LINQ queries against the generated collections. To do this, you use a DataContext object that is created. To write changes back to the database, use the DataContext.SubmitChanges () method.

LINQ to SQL is a simple and easy to use O/RM system. It allows for only simple inheritance or association features. There was talk awhile back about Microsoft retiring it, but it is likely to be around for awhile.

The Entity Framework is a more sophisticated O/RM tool and requires more manual coding. It is more suitable for complex object graphs. It allows for more complex inheritance or association features. The entity classes can be completely independent from the database schema they map to.

Click here for our tutorial on data access in C#.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top