Click here to Skip to main content
15,906,558 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

My c# windows application is crashing when load variables operation is performed in my application. In this operation, the variables queried from compactSqlce is not getting stored in a dataview, in VISTA, but works fine in XP.

The operations throwing exceptiop are,
query.AsDataView();

or
query.copytodatatable();

the query is fetching the required values, but fails to put them to a dataview or datatable.

This issue is occuring only in VISTA

Please help!

Error Details as Below :
Please find the error details as below :

System.TypeLoadException was unhandled

Method 'FindByKey' on type 'System.Data.LinqDataView' from assembly 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is overriding a method that is not visible from that assembly.

   at System.Data.DataTableExtensions.AsDataView[T](EnumerableRowCollection`1 source)
   at IRst_VariableSelectorUIExtension.frmVariableSelector.BeginLoadDataMap(String fileName) in D:\Service Tool_SCM\Source_latest\IRst_VariableSelectorUIExtension\frmVariableSelector.cs:line 920
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)


Many Thanks,
Vidya
Posted
Updated 18-Jan-11 5:18am
v4
Comments
TheyCallMeMrJames 18-Jan-11 0:12am    
What is the error you are seeing? Can you paste any info from the exception that is thrown? If you're not getting a dialog with infos, check the event log. Cheers.
vidya_01 18-Jan-11 0:50am    
Please find the error details as below : System.TypeLoadException was unhandled Method 'FindByKey' on type 'System.Data.LinqDataView' from assembly 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is overriding a method that is not visible from that assembly. at System.Data.DataTableExtensions.AsDataView[T](EnumerableRowCollection`1 source) at IRst_VariableSelectorUIExtension.frmVariableSelector.BeginLoadDataMap(String fileName) in D:\Service Tool_SCM\Source_latest\IRst_VariableSelectorUIExtension\frmVariableSelector.cs:line 920 at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) Many Thanks, Vidya
vidya_01 18-Jan-11 0:51am    
EnumerableRowCollection<devicevariablesdataset.devicevariablelistrow> query =
from rows in mVariableList.AsEnumerable()
where rows.Monitored == true
orderby rows.VariableName
select rows;

mSelectedVariablesLock.EnterWriteLock();
try
{
mSelectedVariables = query.AsDataView();// throwing exception
}
finally
{
mSelectedVariablesLock.ExitWriteLock();
}
Sandeep Mewara 18-Jan-11 0:17am    
Look at EventViewer too for any error logged. Edit your question and update on same.
vidya_01 18-Jan-11 0:51am    
this is the codepiece

EnumerableRowCollection<devicevariablesdataset.devicevariablelistrow> query =
from rows in mVariableList.AsEnumerable()
where rows.Monitored == true
orderby rows.VariableName
select rows;

mSelectedVariablesLock.EnterWriteLock();
try
{
mSelectedVariables = query.AsDataView();// throwing exception
}
finally
{
mSelectedVariablesLock.ExitWriteLock();
}

1 solution

I would try downloading and installing:
Microsoft .NET Framework 3.5 Service Pack 1[^]

Regards
Espen Harlinn
 
Share this answer
 
Comments
vidya_01 18-Jan-11 23:17pm    
Hi Espen, thanks for the input. The VISTA system has .net f/w 3.5 sp1 installed.
However I found out that the method asdataview is supported in VISTA sp1 or later.
I want to know if there is a work around for VISTA with versions previous to SP1.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900