Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
Questionhow to pass Comparison Operators as parameter to query in C#? Pin
obarahmeh4-May-09 0:20
obarahmeh4-May-09 0:20 
AnswerRe: how to pass Comparison Operators as parameter to query in C#? Pin
Eddy Vluggen4-May-09 0:31
professionalEddy Vluggen4-May-09 0:31 
GeneralRe: how to pass Comparison Operators as parameter to query in C#? Pin
obarahmeh4-May-09 1:26
obarahmeh4-May-09 1:26 
GeneralRe: how to pass Comparison Operators as parameter to query in C#? Pin
Eddy Vluggen4-May-09 7:09
professionalEddy Vluggen4-May-09 7:09 
GeneralRe: how to pass Comparison Operators as parameter to query in C#? Pin
obarahmeh4-May-09 22:31
obarahmeh4-May-09 22:31 
QuestionA simple question... please help Pin
Reyals4-May-09 0:08
Reyals4-May-09 0:08 
AnswerRe: A simple question... please help Pin
SeMartens4-May-09 0:16
SeMartens4-May-09 0:16 
AnswerRe: A simple question... please help Pin
OriginalGriff4-May-09 0:18
mveOriginalGriff4-May-09 0:18 
namespace WindowsFormsApplication3
   {
   class Class1
      {
      public String astring;
      public static void asdf()
         {
         String anotherstring;
         astring = anotherstring; //It doesn't like this
         }
      }
   }


Because you have declared astring with "public String astring" within your class body, it only exists when you have an instance of the class "Class1".
Because you have declared asdf() as "public static void asfd()" it is a static method - i.e. can be used by "Class1.asdf()" rather than via an instance as shown below:
Class1 c = new Classs1();
c.asfd();


When you execute asdf() as a static method, there is no "this" instance for the astring reference to attach to!

Either, make the astring definition static, or remove the static declaration from the asdf() definition, depending on how you want to use the method / sting.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

AnswerRe: A simple question... please help Pin
Reyals4-May-09 0:42
Reyals4-May-09 0:42 
AnswerRe: A simple question... please help Pin
OriginalGriff4-May-09 1:02
mveOriginalGriff4-May-09 1:02 
GeneralRe: A simple question... please help Pin
Reyals4-May-09 1:37
Reyals4-May-09 1:37 
JokeRe: A simple question... please help Pin
OriginalGriff4-May-09 1:52
mveOriginalGriff4-May-09 1:52 
QuestionFire enter key Pin
rmedo3-May-09 23:55
rmedo3-May-09 23:55 
AnswerRe: Fire enter key Pin
stancrm4-May-09 0:37
stancrm4-May-09 0:37 
AnswerRe: Fire enter key Pin
Member 44703544-May-09 0:50
Member 44703544-May-09 0:50 
GeneralRe: Fire enter key Pin
rmedo4-May-09 2:46
rmedo4-May-09 2:46 
QuestionSQL SCRIPT Pin
kibromg3-May-09 23:20
kibromg3-May-09 23:20 
AnswerRe: SQL SCRIPT - cross post Pin
Mycroft Holmes3-May-09 23:25
professionalMycroft Holmes3-May-09 23:25 
QuestionCtrl+A short key in listview Box Pin
S K Y3-May-09 23:11
S K Y3-May-09 23:11 
AnswerRe: Ctrl+A short key in listview Box Pin
Christian Graus3-May-09 23:14
protectorChristian Graus3-May-09 23:14 
AnswerRe: Ctrl+A short key in listview Box Pin
sbscb3-May-09 23:23
sbscb3-May-09 23:23 
Questiondrag node with its childs from one tree to other Pin
Nomz1233-May-09 23:06
Nomz1233-May-09 23:06 
AnswerRe: drag node with its childs from one tree to other Pin
Mycroft Holmes3-May-09 23:28
professionalMycroft Holmes3-May-09 23:28 
GeneralRe: drag node with its childs from one tree to other Pin
Nomz1233-May-09 23:30
Nomz1233-May-09 23:30 
GeneralRe: drag node with its childs from one tree to other Pin
Mycroft Holmes3-May-09 23:54
professionalMycroft Holmes3-May-09 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.