Solved

new in C#

Posted on 2011-09-16
2
255 Views
Last Modified: 2012-05-12
Hi,

I am trying to learn C# from a VB background.
Normally in my classes I use a new sub to declare a new instance of the class objects. But when I try this in C# I run into all sorts of errors. Do you need to use the new sub in C# at all?
If you do, what would be the conversion for the code below?

Many thanks

Imports Obout.Grid
Imports System.Web.UI.WebControls

Public Class GridFactory

    Private GridFolderStyle As String

    Private Property _Grid As Grid

    Public Sub New()

        GridFolderStyle = ApplicationConfiguration.GridPath.ToString

        _Grid = New Grid()
        _Grid.Columns.Clear()

    End Sub
0
Comment
Question by:Soluga
2 Comments
 
LVL 2

Accepted Solution

by:
arundhaj earned 500 total points
Comment Utility

import obout.Grid;
import System.Web.UI.WebControls;

public class GridFactory
{
      private String GridFolderStyle;
      private Grid _Grid;
      
      public void New()
      {
            GridFolderStyle = ApplicationConfiguration.GridPath.ToString();
            _Grid = new Grid();
            _Grid.Columns.Clear();
      }
}
0
 
LVL 1

Author Closing Comment

by:Soluga
Comment Utility
Changed the import to using.
But great.
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Best way to handle data being sent over a serial COM 5 23
c# code 19 57
dynamic menu in asp.net c# 11 26
Calling stored proc in EDMX 11 17
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now