Sachin Doshi

Sachin Doshi

  • NA
  • 11
  • 0

which one is the right choice Struct or Class?

Dec 7 2006 2:13 AM

I am trying to use a private class within my main class to implement following functionality
I want to use all my select queries in this fashion.

Selects.SQL1
Selects.SQL2
So should i create a struct or a Class to achive this.

I want to do the same thing for my message class.
Messages.msg1
Messages.msg2

Please suggest the right way to do it and reason on doign that way.

public class MainClass
{
private
struct Selects
{
public static string SQL1 = "SELECT LOOKUP_TEXT,LOOKUP_TEXT_CAPTION FROM BT_LOOKUP WHERE LOOKUP_TYPE_ID = 242 ORDER BY LOOKUP_TEXT";
public static string SQL2 = "SELECT LOOKUP_TEXT,LOOKUP_TEXT_CAPTION FROM BT_LOOKUP WHERE LOOKUP_TYPE_ID = {0}";
.
.
.

}

//Selects.SQL1;
//string.format(Selects.SQL2,"242");

}

or should I use this way

public class MainClass
{
private class Selects
{
public static string SQL1 = "SELECT LOOKUP_TEXT,LOOKUP_TEXT_CAPTION FROM BT_LOOKUP WHERE LOOKUP_TYPE_ID = 242 ORDER BY LOOKUP_TEXT";
public static string SQL2 = "SELECT LOOKUP_TEXT,LOOKUP_TEXT_CAPTION FROM BT_LOOKUP WHERE LOOKUP_TYPE_ID = {0}";
.
.
.

}
//Selects.SQL1;
//string.format(Selects.SQL2,"242");

}