Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Assigning value to a DataRow

Reply
Thread Tools

Assigning value to a DataRow

 
 
Shock
Guest
Posts: n/a
 
      04-12-2004
Anybody ever tried to assign certain values in one datarow to certain
locations in another datarow?

Here is my code to this pont. Followed by the output from the command
window in vs.net debugging mode.

targetRow[0].BeginEdit();

targetRow[0].ItemArray[grwFSAIndex] = dr.ItemArray[fsaIndex];

targetRow[0].ItemArray[grwFSAFieldIndex] = dr.ItemArray[fsaFieldIndex];

targetRow[0].ItemArray[grwFSATractIndex] = dr.ItemArray[fsaTractIndex];

targetRow[0].EndEdit();



Output:

dr.ItemArray

{Length=6}

[0]: "83"

[1]: "91667"

[2]: "1234"

[3]: "56"

[4]: "7"

[5]: "4"



targetRow[0].ItemArray

{Length=12}

[0]: "Name"

[1]: {83}

[2]: "Other Name"

[3]: "The name"

[4]: {14544}

[5]: {91667}

[6]: "WY"

[7]: "Vincent"

[8]: {4.78}

[9]: ""

[10]: ""

[11]: ""



As you can see, after the assignment the columns 9 to 11 on targetRow should
be set to the values 2 to 4 on dr. The column variable numbers are correct
in my code, but for some reason I cannot get the values to be assigned.

Thanks ahead,

Shock


 
Reply With Quote
 
 
 
 
Shock
Guest
Posts: n/a
 
      04-13-2004

"Shock" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Anybody ever tried to assign certain values in one datarow to certain
> locations in another datarow?
>
> Here is my code to this pont. Followed by the output from the command
> window in vs.net debugging mode.
>
> targetRow[0].BeginEdit();
>
> targetRow[0].ItemArray[grwFSAIndex] = dr.ItemArray[fsaIndex];
>
> targetRow[0].ItemArray[grwFSAFieldIndex] = dr.ItemArray[fsaFieldIndex];
>
> targetRow[0].ItemArray[grwFSATractIndex] = dr.ItemArray[fsaTractIndex];
>
> targetRow[0].EndEdit();
>
>
>
> Output:
>
> dr.ItemArray
>
> {Length=6}
>
> [0]: "83"
>
> [1]: "91667"
>
> [2]: "1234"
>
> [3]: "56"
>
> [4]: "7"
>
> [5]: "4"
>
>
>
> targetRow[0].ItemArray
>
> {Length=12}
>
> [0]: "Name"
>
> [1]: {83}
>
> [2]: "Other Name"
>
> [3]: "The name"
>
> [4]: {14544}
>
> [5]: {91667}
>
> [6]: "WY"
>
> [7]: "Vincent"
>
> [8]: {4.78}
>
> [9]: ""
>
> [10]: ""
>
> [11]: ""
>
>
>
> As you can see, after the assignment the columns 9 to 11 on targetRow

should
> be set to the values 2 to 4 on dr. The column variable numbers are

correct
> in my code, but for some reason I cannot get the values to be assigned.
>
> Thanks ahead,
>
> Shock
>
>

Awww. I am bummed, nobody can help me. LOL.

Shock


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get dataRow value from false column name orenl ASP .Net 1 12-04-2006 01:12 PM
Assigning methods to objects, and assigning onreadystatechange to an XMLHttpRequest -- an inconsistency? weston Javascript 1 09-22-2006 09:33 AM
Is it possible to bind a datarow to the value of a DDL? RSH ASP .Net 2 09-21-2006 12:35 PM
Binding a dynamic textbox to DataRow.Item(1) value Ali M ASP .Net 2 02-15-2005 08:26 PM
C# - get value of a column in a DataRow Chet ASP .Net 3 12-31-2003 04:26 PM



Advertisments