troubleshooting Question

Can I add an object directly to a Data Row?

Avatar of guxiyou
guxiyou asked on
7 Comments1 Solution747 ViewsLast Modified:
Ok, this is probably an easy question, but here goes.  When you add to the DataRowCollection of a DataTable, it says that there are two overloads:
1) DataRowCollection.Add(params object [] values)
2) DataRowCollection.Add(DataRow row)

So my question is this, if I've declared the DataTable to be a table consisting of a single row, say "ID", then can I add the single value as just  DataRowCollection.Add(value), assuming that value is of type object? Since value is of type object, not of type object [], is this still correct (standard)? I have written a program that demonstrates that this works, but I need to know whether this is standard.  So, I'll award points to the first person to explain how this behavior is/is not standard (this would include references to the standard or other credible sources).

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros