PC Review


Reply
Thread Tools Rate Thread

after dataset.merge(..) datacolumn.expression is not working?

 
 
Giedrius
Guest
Posts: n/a
 
      12th Aug 2005
hello,
I have a typed dataset, with tables where some columns are with expressions
like
.CaptionColumn.Expression = "ISNULL([Alias], [Name])"

After doing

DataGrid.DataSource = MyTypedDataSet
DataGrid.DataMember = "Table"

newDataSet = Me.GetData()
MyTypedDataSet.Clear
MyTypedDataSet.Merge(newDataSet, "Table")
MyTypedDataSet.AcceptChanges

Columns with expressions are not calculated, and viewing in Grid show only
blank space in these columns.
However exporting to XML, or resetting .Expression = .Expression, helps.

So am I missing something after merging data or this is by design?

 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      12th Aug 2005
Hi,

I would avoid using Expressions in non-readonly scenarios as there are some
problems.
Rather do the expressions yourself (use DataTable events to fill the fields)
and AcceptChanges on row if it was unchanged before.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Giedrius" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hello,
> I have a typed dataset, with tables where some columns are with
> expressions like
> .CaptionColumn.Expression = "ISNULL([Alias], [Name])"
>
> After doing
>
> DataGrid.DataSource = MyTypedDataSet
> DataGrid.DataMember = "Table"
>
> newDataSet = Me.GetData()
> MyTypedDataSet.Clear
> MyTypedDataSet.Merge(newDataSet, "Table")
> MyTypedDataSet.AcceptChanges
>
> Columns with expressions are not calculated, and viewing in Grid show only
> blank space in these columns.
> However exporting to XML, or resetting .Expression = .Expression,
> helps.
>
> So am I missing something after merging data or this is by design?
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet.Merge and Column.Expression tomb Microsoft ADO .NET 3 20th May 2005 01:00 AM
DataSet.Merge with Column.Expression. expression not =?Utf-8?B?R2llZHJpdXM=?= Microsoft ADO .NET 4 12th Jan 2005 09:45 AM
DataColumn DataSet Expression problem, circular? =?Utf-8?B?c2Np?= Microsoft ADO .NET 0 7th Apr 2004 07:36 PM
Expression DataColumns don't get evaluated after a DataSet Merge() Germán Microsoft ADO .NET 0 30th Sep 2003 01:44 PM
DataSet Merge & Expression Fields Laura Villa Microsoft ADO .NET 0 1st Sep 2003 04:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 AM.