.net

How can i convert my string with my common language to English?

i have some excell data. also excel column i created programmaticaly in sql tablr my excel column on the other hand; some column's name is "mydetail" if converting to to upper MYDETAİL. i must this ToUpper() event : MYDETAIL not MYDETAİL ...

DB4o Linq query - How to check for null strings

Hey there - simple query: var q = (from SomeObject o in container where o.SomeInt > 8 && o.SomeString != null //Null Ref here select o; I always get a null reference exception. If I use String.IsNullOrEmpty(o.SomeString) the query takes about 100 times as long, as if I use && o.SomeString != "" (which is way faster, but o...

Is it possible to use pure Encrypting and Decrypting keys in asymmetric cryptography instead of private and public keys?

Is it possible to use pure Encrypting and Decrypting keys instead of private and public keys? As I know in .Net asymmetric RSA implementation private key RSAParameters parameters = (new RSACryptoServiceProvider()).ExportParameters(true) is a superset of public key. And using private key we can both encrypt and decrypt our data. But I nee...

Entity framework MappingException: The type 'XXX has been mapped more than once

Hi everyone, I'm using Entity framework in web application. ObjectContext is created per request (using HttpContext), hereby code: string ocKey = "ocm_" + HttpContext.Current.GetHashCode().ToString(); if (!HttpContext.Current.Items.Contains(ocKey)) { HttpContext.Current.Items.Add(ocKey, new ElevationEntityModel(EFConnectionString))...

Is there a .NET BCL class to help with hand-rolled property path binding?

WPF and Silverlight have a data binding model whereby I can provide a Binding with a Path which comprises a dot-notation of property accessors down from a DataContext to a specific value inside a complex object graph (eg. MyDataContext.RootProperty.SubProperty.Thing.Value) I have a (non-UI) requirement to accept such a path expressed a...

Can I configure AutoMapper to read from custom column names when mapping from IDataReader?

Psuedo code for mapping configuration (as below) is not possible since the lambda only lets us access Type IDataReader, wheras when actually mapping, AutoMapper will reach into each "cell" of each IDataRecord while IDataReader.Read() == true: var mappingConfig = Mapper.CreateMap<IDataReader, IEnumerable<MyDTO>>(); mappingConfig.ForMembe...

Advice on C #,ADO,LINQ,Winform

HI=i, I need advice on how i should go about improving my c # skills. I want to improve my skills in general c#,ADO,linq and windows form applications. ...

Form with list of checkboxes (best practices)

I have a view that allows the user to make a selection from an IEnumerable. The way I'm doing it now is to give each checkbox the id of the item and work with the form collection at the controller's side. I seem to remember there to be a better way but can't remember how anymore. Are there any better practices? ...

IEnumerator: Is it normal to have an empty Dispose method?

I'm writing an IEnumerator<T> class to iterate over a COM collection I'm wrappering. I've noticed that IEnumerator<T> extends IDisposable, so I'm required to implement the Dispose method. However, I can't think of anything I would put there, as I only have a reference to the collection (which I wouldn't want being disposed at the end...

How to access Excel Max Column value?

i try to create table from excel rows. however; excel columns : column1 has max 200 character row column2 has max 300 character row column3 has max 500 character row So i need to create sql create MyTable column3 nvarchar(500) according to Excel Max Character. ...

C# dataset and DbNull values.

Hi All. I've a general question - Lets say I've an SQL Server 2008 DB , and it has some nullable columns. Some of these are null and some are not. Next, I query the DB for a DataRow in C#. What value would these null fields have in the DataRow object? I'm seeing that they have C# "null" values, but someone here said that DbNull != C#...

MEF: Satisfy part on an Export using and Export from the composed part.

Hi, I have the following scenario in Silverlight 4: I have a notifications service Snippet [InheritedExport] public interface INotificationsService : IObservable<ReceivedNotification> { void IssueNotifications(IEnumerable<ClientIssuedNotification> notifications); } and and implementation of this service Snippet [PartCreationP...

Is it possible to run Silverlight code using the runtime of the full .NET framework?

To integrate with the current system for continuous integration, we want to use NUnit for testing (non UI) Silverlight code. Doing this means executing Silverlight code using the runtime of the full .NET framework which usually works just fine as long as not actually using Silverlight specific classes such as the visual elements or Depen...

How to compare two xml schemas

We generate xml schema for our web services. Amongst other details these schema contain the defintion of the complex types consumers of our services pass in. Those complex types can change if our third party suppliers decide they want to add more details but as can be imagined that's something that shouldn't happen on the whim of a d...

Does order matter when registering, gac-ing assemblies for COM interop?

When registering .NET assemblies for COM Interop, I do two things, currently in this order: regasm /tlb:MyDll.tlb Mydll.dll gacutil /i Mydll.dll I use regasm to register the type library for COM and gacutil to install the assembly into the GAC. Does it matter which order I do these two actions? Also, as I make updates to my dll, do...

Show ContextMenuStrip from ToolStripDropDown without dismissing ToolStripDropDown

I have a ToolStrip. In my ToolStrip I have a ToolStripDropDownButton. My ToolStripDropDownButton has a DropDown of type ToolStripDropDown that contains a ToolStripControlHost which contains a Label. I have assigned a ContextMenuStrip to my Label. When I show the DropDown and right-click on the label, the ContextMenuStrip displays cor...

How to use Nant and MSBuild to build debug deployment

Hi I have a Nant build script which referrences 30 other build scripts. Each build script referrences a visual studio solution using MSBuild. Each solution has 3 to 5 projects in. Some projects are Class Librarys and some are Web Apllications. The projects reference other projects both in their solution and out of their solution, so...

How can i sort DESC and ASC in list generic?

How can I sort DESC and ASC in a generic list? With LINQ and without LINQ ? I'm using vs 2008. class Program { static void Main(string[] args) { List<int> li = new List<int>(); li.Add(456); li.Add(123); li.Add(12345667); li.Add(0); li.Add(1); ...

Make Windows application work on Mac OS X

Please suggest ways to deliver Windows application (.NET) to Mac OS X. Mono isn't an option, I'm looking for a solution that requires no code changes. I'm considering VirtualBox virtualization (http://www.virtualbox.org). Any other suitable options? Thanks! ...

Query a stored procedure for it's parameter names and types

Is there any easy way to query a stored procedure (Oracle - PL/SQL) for what parameters it expects? I know that I can query USER_SOURCE to get the whole procedure but I'd then have to parse the whole procedure, and if the parameter is of type [table].[column]%TYPE I'd then have to query the table schema as well. Either using just sql o...