J
Jason
First off, I tried to find an ADO.NET forum, or even just
a .NET framework forum but couldn't seem to locate one and
I apologize in advance if I've posted in the wrong place.
Because I'm using a dataset in VB.NET I figured this was
the next logical place to ask my question.
I'm using the DataColumn.Expression property, and when I
call the function with a '\' I get a crash.
Here is my code:
For Each columnToSum In columnsWithSumsList
Dim expression As String
expression = "SUM([" & CStr(columnToSum) & "])"
expression = expression.Replace("\", "[\]")
'do the actual sum computation
Dim sum As Object = detailsTable.Compute(expression,
filter)
If Not IsDBNull(sum) Then
newRow(columnToSum) = CDbl(sum)
End If
Next
Basically when I send in the columnToSum = '\' I then
change it to SUM([\]) (square brackets handle the
sensitive characters. But I get problems because the [\]
actually equals "[]"
I'm not sure of what string modification i need to make to
my expression that allows it to be save when users input a
forward slash. If anyone has any ideas I'd sure
appreciate it!
Thanks in advance!
a .NET framework forum but couldn't seem to locate one and
I apologize in advance if I've posted in the wrong place.
Because I'm using a dataset in VB.NET I figured this was
the next logical place to ask my question.
I'm using the DataColumn.Expression property, and when I
call the function with a '\' I get a crash.
Here is my code:
For Each columnToSum In columnsWithSumsList
Dim expression As String
expression = "SUM([" & CStr(columnToSum) & "])"
expression = expression.Replace("\", "[\]")
'do the actual sum computation
Dim sum As Object = detailsTable.Compute(expression,
filter)
If Not IsDBNull(sum) Then
newRow(columnToSum) = CDbl(sum)
End If
Next
Basically when I send in the columnToSum = '\' I then
change it to SUM([\]) (square brackets handle the
sensitive characters. But I get problems because the [\]
actually equals "[]"
I'm not sure of what string modification i need to make to
my expression that allows it to be save when users input a
forward slash. If anyone has any ideas I'd sure
appreciate it!
Thanks in advance!