.net

Expose additional classes in ASP.NET 2.0 webservice

Consider a webmethod which exposes an abstract class: [WebMethod] public void Save(AbstractEntity obj) { // .. } There are several classes inheriting from AbstractEntity like public class Patient : AbstractEntity { // ... } Now I want to enable the webservice consumer to create a new Patient object and save it: service....

WPF C# undo redo

I have to do UNDO REDO implementation in WPF for NumericEditors like textbox. I am using infragistics xamNumericEditor control. How can I start? Which method is best to follow. I have searched net. Found that memento and command patterns are there. Which one is best? ...

The fastest way to call a method

Reading this article I found several ways to call a method. Method to call: public static void SendData(string value) { } Calls: delegate void MyDelegate(string value); //Slow method - NOT RECOMMENDED IN PRODUCTION! SendData("Update"); // Fast method - STRONGLY RECOMMENDED FOR PRODUCTION! MyDelegate d = new MyDelegate(Send...

stackoverflow exception in form class

When I try to create an object of the form class within the form class, it gives an exception as stackoverflow occured.However, when I declare the object of form class within a method,it works fine.the code is as follows: namespace WindowsFormsApplication6 { public partial class Form1 : Form { **Form1 f1 = new Form1(...

Can WCF be used to have a REST API URL like http://yourhost.com/{service-contract}.{binding}?op={target-method}?

I'm wondering if I can use WCF so that the client can set the appropriate binding by just changing the URL. Some examples: URL: http://yourhost.com/orders.json?op=getall Description: get all orders as JSON. URL: http://yourhost.com/orders.xml?op=getall Description: get all orders as XML. URL: http://yourhost.com/orders.soap?op=get...

.NET WebParts...

I am new to WebParts and have a newbie question... is it possible to load webparts from other sites like MSN? For example, can a user save the weather web part from theie MyMSN site and load into my newly created site that allows web parts. Thanks in advance for any help. ...

ASP.Net Cache sharing

I have an ASP.Net 4.0 web application which very frequently loads data from the database and does heavy calculations on it. I want to cache this loaded and prepared data in a central cache that can be accessed by every user and computer who uses the application. Simple use-case: User 1 accesses webpage, cache is empty, data is loaded/...

Problem while reading excel file in C# with ADO.Net

Hello everyone, I just started C# today, and i have trouble reading an excel file. Here's what i did : OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filePath + @";Extended Properties=""Excel 12.0;HDR=YES;"""); OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet$]", conn...

What is the best way to support multiple architectures in a mixed managed/unmanaged environment?

Background We have a .NET library that is referencing one of our unmanaged dlls, lets say: DotNet.dll Unmanaged.dll Thus far, Unmanaged.dll is only 32-bit, so the DotNet.dll is marked with 32-bit CPU type. 64-bit support needs to be added. How to organize the dlls? IL code of DotNet.dll will be the same for both 32-bit and 64-bit ...

Is there a way to programatically remove controls from C:\Windows\downloaded program files?

I am trying to create a tool that will perform some "clean up" functions for some non-technical Windows users. Most of the work will be unregistering dll files from previous versions of the client (ActiveX based) and then reinstalling the most current version from an msi file. The problem I have is in properly removing downloaded contro...

OLEdbcommand.Prepare error

I am getting an error: OleDbCommand.Prepare method requires all parameters to have an explicitly set type. on the last line of the code below. I have seen things saying you have to set the datatype of each parameter but how can i do that when it being generated by the command builder? I have seen people say they dont like using autoge...

How to connect and synchronize Lotus Notes calendar with Windoes CE custom application

We are developing custom appication on Win CE and we need to synchronize data on device with calendar of selected user. thanks for help ...

Is SQL Server Compact Edition a sensible alternative to SQLite?

What are the differences, other than a file size restriction in SQL Server Compact, and Windows only usage? ...

XSD .net code gen + alternative serialization methods

I'm having a time deciding on a direction to go with a class lib I'm building. I have a batch of industry standard XSD's, from which I'm generating .net objects. I;ve used all of XSD.exe, LinqtoXsd, xsd2code, and even OxmLibrary with varying results. But in the end, I am able to generate decent .net classes which can be serialized/dese...

Download a file From https using VB.net

Could anyone help me please ? I need to download a file from web i.e https:\www.xxx.com\ using vb.net and save it to C drive of system. Below is the code : Dim URI As String = ftpHost & ftpFile Dim oRequest As System.Net.HttpWebRequest = CType(HttpWebRequest.Create(URI), HttpWebRequest) oRequest.Credentials = New System.Net.NetworkCre...

Should I use the built-in membership provider for an ASP .NET MVC application?

I've been using a custom membership provider for authentication in all my web form applications till now. I'm about to start developing my first website using MVC. I'm wondering if I should I use the built-in membership provider that ships with ASP .NET MVC, or if I should create my own. My site needs to integrate with openid, faceboo...

How can I upload large (30Mb) files in a ASP.NET application ? (VB) I've tried raising MaxRequestLength, but no luck..

How can I upload large (30Mb) files in a ASP.NET application ? (VB) I've tried raising MaxRequestLength, but no luck... I'm using the FileUpload control, I already googled this issue a bit, and people seem to solve it by raising MaxrequestLenght on the web.config file. I did that, and it didn't work. I also raised it on the code, and s...

LINQ to SQL: how to update the only field without retrieving whole entity

I want to update the only field of entity when I know entity Id. Is it possible in LINQ to SQL without retrieving full entity (with all fields from DataContext that is overhead) ? Is it possible to create and attach entity to DataContext and mark the exact field(s) to synchronize on DataContext.SubmitChanges (or something like that)? ...

Tools for Deployment of Web Apps

Hi there Just wondering if people are using any particular tools to improve the experience of deploying web applications ( and applications in general) on the .Net stack I use a bunch of scripts and FluentMigrator for my db schema support. But I need to change my web.config, ftp stuff up and down, seems rather manual I m sure there are...

How to tell GC to clean embedded object as well?

We have an event class which has a reference of a MsgBody class: public class StatusEvent { MsgBody msgBody; public StatusEvent(MsgBody body) { msgBody = body; } .... } public class MsgBody { string s1; string s2; ..... } MsgBody class is ONLY used by StatusEvent. No other place a MsgBody is refered. When a ...