Solved

new in C#

Posted on 2011-09-16
2
258 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
ID: 36548158

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
ID: 36548178
Changed the import to using.
But great.
Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

789 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