By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,081 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,081 IT Pros & Developers. It's quick & easy.

DataColumn.Expression delimiter problem.

P: n/a
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!
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Cor
Hi Jason,

This is not an ADO.NET forum question.

If you are lucky Jay B. sees your subject and helps you if he has time for
that.

But don't pay attention to messages that redirects you to other groups.

If this is no VB.language than a regular Expression is also no VB.language,
it is quiet the same.

I don't use it, as I don't use the regular Expression, so if I would help
you it would be the blind who helps the deaf.

But hopefully Jay B has some time for you.

Cor
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.