Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataTable insertion/modification
 

DataTable insertion/modification

Hi all

How do I insert and modifythe following datato an empty datatable?

AAA,BBBB,CCCCC,DDDDD

Each column value are delimited by the comma.

I try to use the method as like excel marco but it seems that row is a ready-only method

Pls advise how should I go about doing it

Tj

Tj Tay  Thursday, June 12, 2008 6:59 AM

Assuming the datatable is already setup you could try something like this

Code Snippet

Dim strIn As String = "aaaa,bbbb,cccc,dddd"

dt.Rows.Add(strIn.Split(","c))

http://msdn.microsoft.com/en-us/library/07wwak56.aspx

Ken Tucker  Thursday, June 12, 2008 10:48 AM

Assuming the datatable is already setup you could try something like this

Code Snippet

Dim strIn As String = "aaaa,bbbb,cccc,dddd"

dt.Rows.Add(strIn.Split(","c))

http://msdn.microsoft.com/en-us/library/07wwak56.aspx

Ken Tucker  Thursday, June 12, 2008 10:48 AM

You can use google to search for other answers

Custom Search

More Threads

• How to add a row to end of datagridview programatically
• System.ArgumentException: The value of DatagridviewComboboxCell is invalid
• Hiding DataGridView selector
• databinding question, please help!!
• Web Service Objects and INotifyPropertyChanged
• UserPreferenceChangedEventHandler
• DataGridView Nested Subgrid
• pasting images onto a control and saving it as bitmap
• datagrid changing datasource at runtime not working 2nd time
• Table or DatGrid...