Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip20-Jul-08 23:00
JoeRip20-Jul-08 23:00 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC20-Jul-08 22:59
J4amieC20-Jul-08 22:59 
QuestionRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip20-Jul-08 23:06
JoeRip20-Jul-08 23:06 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
leppie20-Jul-08 23:24
leppie20-Jul-08 23:24 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 0:05
J4amieC21-Jul-08 0:05 
AnswerRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 0:06
J4amieC21-Jul-08 0:06 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
JoeRip21-Jul-08 0:21
JoeRip21-Jul-08 0:21 
GeneralRe: Can I get the DataTable properties from an arbitrary DataRow? Pin
J4amieC21-Jul-08 0:49
J4amieC21-Jul-08 0: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 21:27
Chetan Patel20-Jul-08 21:27 
AnswerRe: Desktop Sharing Pin
leppie20-Jul-08 22:59
leppie20-Jul-08 22:59 
Questionhow to create a web base vbscript editor by c# Pin
Member 255822720-Jul-08 21:17
Member 255822720-Jul-08 21:17 
Questioninserting float value in sql from c# Pin
ashok@techxygen20-Jul-08 20:46
ashok@techxygen20-Jul-08 20:46 
AnswerRe: inserting float value in sql from c# Pin
C1AllenS20-Jul-08 22:42
C1AllenS20-Jul-08 22:42 
QuestionIs this program thread safe Pin
Mogaambo20-Jul-08 20:32
Mogaambo20-Jul-08 20:32 
AnswerRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 21:12
N a v a n e e t h20-Jul-08 21:12 
GeneralRe: Is this program thread safe Pin
S. Senthil Kumar20-Jul-08 21:16
S. Senthil Kumar20-Jul-08 21:16 
GeneralRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 21:31
N a v a n e e t h20-Jul-08 21:31 
GeneralRe: Is this program thread safe Pin
Mogaambo20-Jul-08 21:46
Mogaambo20-Jul-08 21:46 
AnswerRe: Is this program thread safe Pin
N a v a n e e t h20-Jul-08 21:35
N a v a n e e t h20-Jul-08 21:35 
AnswerRe:Senthil or Navneeth please clear my doubt [modified] Pin
Mogaambo20-Jul-08 21:47
Mogaambo20-Jul-08 21:47 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar20-Jul-08 22:23
S. Senthil Kumar20-Jul-08 22:23 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
Mogaambo20-Jul-08 22:33
Mogaambo20-Jul-08 22:33 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar20-Jul-08 22:44
S. Senthil Kumar20-Jul-08 22:44 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
Mogaambo20-Jul-08 22:49
Mogaambo20-Jul-08 22:49 
GeneralRe:Senthil or Navneeth please clear my doubt Pin
S. Senthil Kumar20-Jul-08 23:01
S. Senthil Kumar20-Jul-08 23: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.