Solved

create new datarow

Posted on 2006-11-01
1
1,337 Views
Last Modified: 2012-06-27
hi

i have a populated array of datarows.  

i want to create a new datarow add a string to it.

then i want to increase the size of the array by 1 and
add the new datarow to this position in the existing array of datarows.

NB - i have to do this via a datarow array - cant avoid it.

can anyone help?

thanks
0
Comment
Question by:cocosteel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
Mihai Stancescu earned 300 total points
ID: 17850930
If the length of the datarow array permits you to insert an other item then you can use the method SetValue.

ex:

DataRow[] dr = new DataRow[] {5};

//if you have filled up the array up to the 4 position try this
dr.SetValue(newDataRow, 5); // make sure that this value is less then the length of the array or else you'll get an exception.

Regards,
Mishu
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question