473,698 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataColumn.Expr ession 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.Expr ession property, and when I
call the function with a '\' I get a crash.

Here is my code:

For Each columnToSum In columnsWithSums List
Dim expression As String
expression = "SUM([" & CStr(columnToSu m) & "])"
expression = expression.Repl ace("\", "[\]")
'do the actual sum computation
Dim sum As Object = detailsTable.Co mpute(expressio n,
filter)

If Not IsDBNull(sum) Then
newRow(columnTo Sum) = 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 2868
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
18715
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 with only 2 decimals (#,##0.00)? In the sample below, amount and taxrate are existing DataColumn's. DataColumn colTax = new DataColumn(); colTax.DataType = System.Type.GetType("System.String"); colTax.ColumnName = "tax";...
4
3222
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 over each document, find out if it contains a header and/or a footer and extract only the main content part. The headers and the footers have no specific format and I have to detect and remove them using a list of strings that may appear as...
1
6466
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: mycode IN ('01','05') Do you have any clues ? Thanks,
1
1712
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 just keys a company to a specific industry. This table can have multiple rows for a single company, since some companies can be involved in multiple industries. Now when I display Companies in a DataGrid, I want a column that prints out all the...
9
1803
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 null C = 3 * B otherwise
11
21898
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 another datetime column in the table. See sample below. How do I do this? Any help would be greatly appreciated. Thanks Private Sub CreateDataTable() dt = New DataTable
0
2280
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 = "my_custom(Child.Test)"; Anyone done this before? Any suggestions on where to start? thanks
0
4557
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 columns to make a derived column. When I run my code, I get this error: ------------
1
7975
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 'Non-JCAHO' END" 'standardCodeColumn.Expression = "CASE WHEN
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.