Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
QuestionHow to insert the XML file in SQL Server Pin
Jieha Lee19-Jan-18 4:23
Jieha Lee19-Jan-18 4:23 
AnswerRe: How to insert the XML file in SQL Server Pin
OriginalGriff19-Jan-18 4:58
mveOriginalGriff19-Jan-18 4:58 
AnswerRe: How to insert the XML file in SQL Server Pin
jschell20-Jan-18 5:54
jschell20-Jan-18 5:54 
GeneralRe: How to insert the XML file in SQL Server Pin
Laxmidhar tatwa technologies23-Jan-18 5:00
Laxmidhar tatwa technologies23-Jan-18 5:00 
GeneralRe: How to insert the XML file in SQL Server Pin
jschell27-Jan-18 5:09
jschell27-Jan-18 5:09 
QuestionCalling a Method from a Form event Pin
ormonds18-Jan-18 14:08
ormonds18-Jan-18 14:08 
AnswerRe: Calling a Method from a Form event Pin
User 740747018-Jan-18 14:35
User 740747018-Jan-18 14:35 
AnswerRe: Calling a Method from a Form event Pin
OriginalGriff18-Jan-18 20:07
mveOriginalGriff18-Jan-18 20:07 
Methods (and fields, properties and events) are part of the class definition: So when you add a method to ClassA, it doesn't exist as part of ClassB. So to access a ClassA method from ClassB, you have to specify which class you are referring to; which class the system should look at - either by specifying a class instance:
C#
Button b = new Button();
b.Text = "Click me!";
Or (in the case of static methods like MyMethod) by specifying the class name:
C#
Program.MyMethod(currentfile, TargetFile);

But you shouldn't really be modifying the Program.cs file - instead add a Utilities.cs file, and create a static class in that. To DO that, right click your project name in the Solution Explorer pane, and select "Add"..."Class...". Change the name from "Class1" to "Utilities" and click the "Add" button.
Change the class to static and add your method to that. Then when you write your code, it's a bit more obvious that these are designed as "generic helper" methods:
C#
Utilities.MyMethod(currentfile, TargetFile);

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

AnswerRe: Calling a Method from a Form event Pin
ormonds19-Jan-18 17:00
ormonds19-Jan-18 17:00 
GeneralRe: Calling a Method from a Form event Pin
OriginalGriff19-Jan-18 20:34
mveOriginalGriff19-Jan-18 20:34 
QuestionWhy ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884018-Jan-18 8:18
Member 1228884018-Jan-18 8:18 
AnswerRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan18-Jan-18 21:10
mveRichard MacCutchan18-Jan-18 21:10 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 7:44
Member 1228884019-Jan-18 7:44 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Richard MacCutchan19-Jan-18 8:01
mveRichard MacCutchan19-Jan-18 8:01 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884019-Jan-18 11:30
Member 1228884019-Jan-18 11:30 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon19-Jan-18 22:22
mvePete O'Hanlon19-Jan-18 22:22 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Member 1228884020-Jan-18 6:59
Member 1228884020-Jan-18 6:59 
GeneralRe: Why ControlAccessibleObject' does not contain a definition for: BUY,SELL Pin
Pete O'Hanlon20-Jan-18 22:27
mvePete O'Hanlon20-Jan-18 22:27 
QuestionProject Reference Installed Applications Pin
TheCoolTech18-Jan-18 5:32
TheCoolTech18-Jan-18 5:32 
AnswerRe: Project Reference Installed Applications Pin
OriginalGriff18-Jan-18 5:48
mveOriginalGriff18-Jan-18 5:48 
AnswerRe: Project Reference Installed Applications Pin
Richard MacCutchan18-Jan-18 6:40
mveRichard MacCutchan18-Jan-18 6:40 
QuestionCannot convert from ref decimal? to ref decimal Pin
Kevin Marois18-Jan-18 5:30
professionalKevin Marois18-Jan-18 5:30 
AnswerRe: Cannot convert from ref decimal? to ref decimal Pin
F-ES Sitecore18-Jan-18 6:12
professionalF-ES Sitecore18-Jan-18 6:12 
GeneralRe: Cannot convert from ref decimal? to ref decimal Pin
Kevin Marois18-Jan-18 6:23
professionalKevin Marois18-Jan-18 6:23 
AnswerRe: Cannot convert from ref decimal? to ref decimal Pin
Gerry Schmitz19-Jan-18 7:38
mveGerry Schmitz19-Jan-18 7:38 

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.