| | |
split string to table
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
Erm, how to split a string using comma separated into a table? Below is my code but the output seems weird:
Lets say the row has 40 elements and 30 rows:
Thanks.....
Lets say the row has 40 elements and 30 rows:
ASP.NET Syntax (Toggle Plain Text)
For Count = 0 To UBound(MyArray) For a = 0 To UBound(MyArray) Dim celNew As New TableCell() 'Dim rowNew As New TableRow() 'MyArray = Split(strContents, ",") celNew.Text = MyArray(a) rowNew.Cells.Add(celNew) Table1.Rows.Add(rowNew) Next Next
Thanks.....
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
good...thanks first, lets say i have this randomized text file:
RFG678,1PASS,2FAILED,FGYIJUH,324,5,6,7
RF34S8,1PASS,2FAILED,FGYIJUH,324,1,6,6
.........
and i use the code below:
I just need to convert it into a table-like data, rows and columns separated nicely by line.
However if i using the code above, i just manage to get this:
RFG678 1PASS 2FAILED FGYIJUH 324 5 6 7 RF34S8 1PASS 2FAILED FGYIJUH 324 1 6 6
thanks
RFG678,1PASS,2FAILED,FGYIJUH,324,5,6,7
RF34S8,1PASS,2FAILED,FGYIJUH,324,1,6,6
.........
and i use the code below:
ASP.NET Syntax (Toggle Plain Text)
Dim strContents As String Dim objReader As StreamReader Dim MyArray As String() Dim a As Integer Dim Count As Integer objReader = New StreamReader("C://Index4.txt") strContents = objReader.ReadToEnd() objReader.Close() For Count = 0 To 67 Dim rowNew As New TableRow() MyArray = Split(strContents, ",") For a = 0 To UBound(MyArray) Dim celNew As New TableCell() 'Dim rowNew As New TableRow() 'MyArray = Split(strContents, ",") celNew.Text = MyArray(a) Label11.Text = celNew.Text rowNew.Cells.Add(celNew) Next Table1.Rows.Add(rowNew) Next
I just need to convert it into a table-like data, rows and columns separated nicely by line.
However if i using the code above, i just manage to get this:
RFG678 1PASS 2FAILED FGYIJUH 324 5 6 7 RF34S8 1PASS 2FAILED FGYIJUH 324 1 6 6
thanks
![]() |
Similar Threads
- Pivot table in DataGrid (VB.NET)
- SQL String question (ASP)
- How to split datetime format? (ASP.NET)
- Collapsible table sorting problem (JavaScript / DHTML / AJAX)
- can anyone make this tree table sort correctly? (JavaScript / DHTML / AJAX)
- conversion of text file into data base file (Visual Basic 4 / 5 / 6)
- adding numbers of binary output (C)
- Datagrid to draw a table (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: Have anyone have the idea
- Next Thread: table control
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox child click commonfunctions compatible confirmationcodegeneration content contenttype courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose feedback flash flv form formatdecimal forms formview gridview homeedition iframe iis javascript jquery listbox login menu microsoft mono mouse mssql multistepregistration news numerical objects order panelmasterpagebuttoncontrols parent radio ratings reportemail rotatepage save schoolproject search security serializesmo.table silverlight smartcard software sql-server sqlserver2005 suse textbox tracking typeof unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio web webapplications webarchitecture webdevelopemnt webprogramming webservice xml youareanotmemberofthedebuggerusers






