Click here to Skip to main content
14,357,121 members
   

C#

 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip21-Jul-08 0:00
memberJoeRip21-Jul-08 0:00 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC20-Jul-08 23:59
memberJ4amieC20-Jul-08 23:59 
QuestionRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip21-Jul-08 0:06
memberJoeRip21-Jul-08 0:06 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
leppie21-Jul-08 0:24
memberleppie21-Jul-08 0:24 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 1:05
memberJ4amieC21-Jul-08 1:05 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 1:06
memberJ4amieC21-Jul-08 1:06 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip21-Jul-08 1:21
memberJoeRip21-Jul-08 1:21 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 1:49
memberJ4amieC21-Jul-08 1:49 
the ref keyword forces the argument to be passed by reference, it has no effect on reference types such as DataRow, but consider the following example with a value type:

static void Main()
{
  int i = 1;
  NoRef(i);
  Console.WriteLine(i); // prints '1'

  WithRef(ref i);
  Console.WriteLine(i); // prints '2'
}

static void NoRef(int i)
{
 i = i +1;
}

static void WithRef(ref int i)
{
 i = i + 1;
}


as for the out keyword, this means that the method itself has to set the value of the param before using it. Hence why you cant check it for null before initializing it to some value.

static void Main()
{
   int i = 0;
   SetOut(out i);
   Console.WriteLine(i); // prints '1'
}

static vouid SetOut(out int i)
{
 i = 1;
}


So to cut a long story short, just remove the out/ref keyword altogether from your method. You can still change the values of your DataRow within your method.
QuestionDesktop Sharing Pin
Chetan Patel20-Jul-08 22:27
memberChetan Patel20-Jul-08 22:27 
AnswerRe: Desktop Sharing Pin
leppie20-Jul-08 23:59
memberleppie20-Jul-08 23:59 
Questionhow to create a web base vbscript editor by c# Pin
Member 255822720-Jul-08 22:17
memberMember 255822720-Jul-08 22:17 
Questioninserting float value in sql from c# Pin
ashok@techxygen20-Jul-08 21:46
memberashok@techxygen20-Jul-08 21:46 
AnswerRe: inserting float value in sql from c# Pin
C1AllenS20-Jul-08 23:42
memberC1AllenS20-Jul-08 23:42 
QuestionIs this program thread safe Pin
Mogaambo20-Jul-08 21:32
memberMogaambo20-Jul-08 21:32 
AnswerRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 22:12
memberN a v a n e e t h20-Jul-08 22:12 
GeneralRe: Is this program thread safe Pin
S. Senthil Kumar20-Jul-08 22:16
memberS. Senthil Kumar20-Jul-08 22:16 
GeneralRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 22:31
memberN a v a n e e t h20-Jul-08 22:31 
GeneralRe: Is this program thread safe Pin
Mogaambo20-Jul-08 22:46
memberMogaambo20-Jul-08 22:46 
AnswerRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 22:35
memberN a v a n e e t h20-Jul-08 22:35 
AnswerRe:Senthil or Navneeth please clear my doubt [modified] Pin
Mogaambo20-Jul-08 22:47
memberMogaambo20-Jul-08 22:47 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar20-Jul-08 23:23
memberS. Senthil Kumar20-Jul-08 23:23 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
Mogaambo20-Jul-08 23:33
memberMogaambo20-Jul-08 23:33 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar20-Jul-08 23:44
memberS. Senthil Kumar20-Jul-08 23:44 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
Mogaambo20-Jul-08 23:49
memberMogaambo20-Jul-08 23:49 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar21-Jul-08 0:01
memberS. Senthil Kumar21-Jul-08 0:01 

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.