Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a record to a dataset
Message
From
10/01/2005 05:13:25
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00975570
Message ID:
00975596
Views:
18
Hi Gerard,

If you loop through the column collection and make sure you cover all the types there would not be any problem if you add a column later on.

Why not write a little class file that takes a datarow as a param byref and initializes it with 'blank' data? Just a suggestion.

>Hi Kevin.. thanks for your reply
>I suspected something like that would have to be done and was just 'hoping' there would have been an easier /shorter way to do it.
>
>The problem with this is that
>1) You have to cycle through each field and initialise it
>2) You have to test on the 'type' of eacj field if its to be done generically
>3) 2 Years on when you add an extra field to the table, it means having to
> go through each piece of code (in evry file in the APP and checking where you have 'added' a record
>
>.... Appe Blank was just so easy.... it did it all for you !!
>
>
>Regards
>Gerard
>
>
>
>>Just as a follow-up, you can also do this...
>>
>>
>>
>>DataRow DrNewRow = myTable.NewRow();
>>DrNewRow["firstname"] = ""
>>
Magnus Nordin
VFP MCP

"We have tested the GUI on 5-year olds. Why? Beacuse they aren't braindead!"
Michael Spindler, Apple

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform