473,378 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

DataColumn.Expression delimiter problem.

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
1 2851
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: J | last post by:
Is there anyway to format a calculated datacolumn? I would like the following column to display as money (formatted as $#,##0.00). Or how about simply displaying the column formatted as a number...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
1
by: Dde | last post by:
Hi everybody, I have a problem with the "IN" operator in a datacolumn expression. I have a datatable on which the following expression works: mycode = '05' but the following does not work:...
1
by: MrNobody | last post by:
Say I have a table of companies, and a table of industries (like automobiles, steel, computers, etc..) A company may be involved in industries, so there's a third table- a mapping table- which...
9
by: G .Net | last post by:
Hi Can anybody help with a problem with Expressions for DataColumns Suppose I have a table with three fields A, B and C. I want an expression in column C so that C = 2 * A if A is not...
11
by: Matt F | last post by:
I'm trying to do something that seems like it should be pretty simple, but haven't found a solution. I am trying to add a datacolumn to a datatable that adds or subtracts a number of days based on...
0
by: whiteboy | last post by:
I want to create my own Aggregate function to be used in the DataColumn.Expression property. So for example, DataColumn col = new DataColumn("foo", typeof(String)); col.Expression =...
0
by: SMH | last post by:
Hi All, I am currently learning .Net 2, studying for 70-528. I've hit a bit of a brick wall with DataColumn.Expression. As I understand it, this can be used to (For example) concatenate two...
1
by: jelling | last post by:
Hi, Is it possible to use a CASE or IF ELSE statement in a datacolumn expression? Here's what I've tried: 'standardCodeColumn.Expression = "CASE StandardsBodyID WHEN 1 THEN 'JCAHO' ELSE...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.