Click here to Skip to main content
15,892,298 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Image preview Pin
Enver Maroshi16-Jul-09 4:02
Enver Maroshi16-Jul-09 4:02 
GeneralRe: Image preview Pin
Rijz16-Jul-09 18:46
Rijz16-Jul-09 18:46 
QuestionBinding Data from Dataset to asp table Pin
getaccessyr16-Jul-09 2:53
getaccessyr16-Jul-09 2:53 
AnswerRe: Binding Data from Dataset to asp table Pin
K030616-Jul-09 3:00
K030616-Jul-09 3:00 
AnswerRe: Binding Data from Dataset to asp table Pin
Muhammad Mazhar16-Jul-09 3:13
Muhammad Mazhar16-Jul-09 3:13 
QuestionSystem.Configuration.ConfigurationManager.AppSettings Pin
Member 426027016-Jul-09 2:14
Member 426027016-Jul-09 2:14 
AnswerRe: System.Configuration.ConfigurationManager.AppSettings Pin
Vimalsoft(Pty) Ltd16-Jul-09 2:49
professionalVimalsoft(Pty) Ltd16-Jul-09 2:49 
Questionerror:Unrecognised grouping construct Pin
Astitva2316-Jul-09 1:04
Astitva2316-Jul-09 1:04 
Public Function ParseCSV(ByVal inputString As String, ByVal Delimiter As String) As DataTable
Dim dt As New DataTable
Dim re As New Regex("((?[^""" + Delimiter + "\r\n]+)|""(?([^""]|"""")+)"")(" + Delimiter + "|(?\r\n|\n|$))")

Dim colArray As New ArrayList
Dim rowArray As New ArrayList
Dim colCount As Integer = 0
Dim maxColCount As Integer = 0
Dim rowBreak As String = ""
Dim field As String = ""
Dim mc As MatchCollection = re.Matches(inputString)
For Each m As Match In mc
'Retrieve the Field and Replace Two Double Quotes with Single Double Quote
field = m.Result("${field}").Replace("""""", """")

rowBreak = m.Result("${rowbreak}")

If field.Length > 0 Then
colArray.Add(field)
colCount = colCount + 1
End If

If rowBreak.Length > 0 Then
'Add the Column array to the Row Array List
rowArray.Add(colArray.ToArray)
'Create a new arraylist to hold the field values
colArray = New ArrayList
If colCount > maxColCount Then
maxColCount = colCount
End If
colCount = 0
End If
Next

If rowBreak.Length = 0 Then
'This is executed when the last line doesnt end with a line break
rowArray.Add(colArray.ToArray)
If colCount > maxColCount Then
maxColCount = colCount
End If
End If

'Create the Columns for the table

For i As Integer = 0 To maxColCount - 1
dt.Columns.Add([String].Format("col{0:000}", i))
Next

'Converting The RowArrayList to Array Object for easier access

Dim ra As Array = rowArray.ToArray

For j As Integer = 0 To ra.Length - 1
Dim dr As DataRow = dt.NewRow
'Converting the Column Array List into an Array Object For Easy Access
Dim ca As Array = CType(ra.GetValue(j), Array)
' for each field into the new datarow
For k As Integer = 0 To ca.Length - 1
dr(k) = ca.GetValue(k)
Next
dt.Rows.Add(dr)
Next
If dt.Columns.Count = 0 Then
dt.Columns.Add("NoData")
End If
Return dt
End Function

I am trying to use the above code to parse csv file but get the error unrecognised grouping construct on line Dim re As New Regex("((?[^""" + Delimiter + "\r\n]+)|""(?([^""]|"""")+)"")(" + Delimiter + "|(?\r\n|\n|$))")
AnswerRe: error:Unrecognised grouping construct Pin
Christian Graus16-Jul-09 1:25
protectorChristian Graus16-Jul-09 1:25 
QuestionIIS and Authorisation error Pin
koolprasad200316-Jul-09 0:53
professionalkoolprasad200316-Jul-09 0:53 
AnswerRe: IIS and Authorisation error Pin
Abhijit Jana16-Jul-09 1:00
professionalAbhijit Jana16-Jul-09 1:00 
GeneralRe: IIS and Authorisation error Pin
koolprasad200316-Jul-09 22:44
professionalkoolprasad200316-Jul-09 22:44 
QuestionProblem in databse degining with .net. Pin
rinku soni 2316-Jul-09 0:41
rinku soni 2316-Jul-09 0:41 
AnswerRe: Problem in databse degining with .net. Pin
Abhijit Jana16-Jul-09 0:54
professionalAbhijit Jana16-Jul-09 0:54 
QuestionRegarding ASP.Net using JSON, without AJAX Pin
G Nathan15-Jul-09 23:53
G Nathan15-Jul-09 23:53 
AnswerRe: Regarding ASP.Net using JSON, without AJAX Pin
Blue_Boy16-Jul-09 0:34
Blue_Boy16-Jul-09 0:34 
QuestionFree Online Tutions ?? Pin
Sabari MD15-Jul-09 23:52
Sabari MD15-Jul-09 23:52 
AnswerRe: Free Online Tutions ?? Pin
vaghelabhavesh16-Jul-09 1:46
vaghelabhavesh16-Jul-09 1:46 
GeneralRe: Free Online Tutions ?? Pin
Sabari MD19-Mar-10 1:47
Sabari MD19-Mar-10 1:47 
QuestionProblem in Printing Report Pin
PmSapkota15-Jul-09 23:00
PmSapkota15-Jul-09 23:00 
AnswerRe: Problem in Printing Report Pin
Abhishek Sur16-Jul-09 3:25
professionalAbhishek Sur16-Jul-09 3:25 
QuestionGlobalization and Localization Issue Pin
grewin15-Jul-09 22:56
grewin15-Jul-09 22:56 
Questionwhen remove item from list box using JS and but still display in view state Pin
anish27patel15-Jul-09 22:39
anish27patel15-Jul-09 22:39 
QuestionSearch for WebDAV component Pin
sg87915-Jul-09 22:08
sg87915-Jul-09 22:08 
Questionproblem in connectivity. Pin
rinku soni 2315-Jul-09 21:57
rinku soni 2315-Jul-09 21:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.