.net

Domaintypes in c# from SQL Anywhere

I want to know domain type of scema for a select in SQL Anywhere. SQL: CREATE DOMAIN "followinteger" INTEGER NULL; CREATE TABLE "DBA"."test" ( "follow" "followinteger" NOT NULL, "test" INTEGER NULL, PRIMARY KEY ( "follow" ASC ) ); C# SACommand command = conn.CreateCommand(); command.CommandText = "SELECT * FROM USERS"; ...

difference between asynchronous calls and asynchronous io calls in .net

Using a delegate I can call any function asynchronously. From the documentation I understand this is done by queueing a workitem for the threadpool. One can also do asynchronous calls to IO functions (like reading from sockets, files, webpages, etc). I think (but I'm not sure) this does NOT spawn a workitem in the threadpool. Only after...

How to exchanged data between desktop and mobile applications based on managed code

I develop the desktop application running under WinXPSP3 that should communicate to the other application, located at the mobile device running under Windows Mobile 2003/2005 and docked to the host with ActiveSync running. I have searched for some mechanism that looks like WCF, but failed to find any. Does BCL contain any classes that ca...

Using WPF UI thread should always ensure STA apartment mode, right?

In my WPF application I communicate asynchronously with a server. The callback will hence not be run in the UI thread, and as I need to do some WPF stuff there (create InkPresenter object) I need it to be run on the UI thread. Well, actually the requirement is that it is run on a thread with STA apartment mode. I tried creating a new thr...

Cross AppDomain Exception serialization

Hi, Given two app domain : in the first, Library1 and CommonLibrary are loaded. In the second Library2 and CommonLibrary are loaded. Library2 defines a Library2Exception that inherit from CommonException (defined in CommonLibrary). When I call, in the first AppDomain, a method on a MarshallByRef of the second AppDomain that throws a Li...

Purpose of C# constructor extern modifier

What is the Purpose of C# constructor extern modifier? I know about usage of extern METHODS to invoke Win32 functions, but what about CONSTRUCTORS? Please give the practical example. Not this: class MyClass { public extern MyClass(); } ...

The State of a listView item in the DrawItem event is wrong

The question is in the code. Cannot understand why this is happening. private void listView_DrawItem(object sender, DrawListViewItemEventArgs e) { // This works Ok if (e.Item.Selected) { // ... } // This works wrong! // e.State is always Selected! Why? if ((e.State & ListViewItemStates.Selected) != 0...

Removed WebMethod from ASP.NET Webservice, method still shows up

I changed the signature of one of my web methods in a web service and couldn't get it to update, so now I've removed the whole method and rebuilt the project and that removed method still shows up and works! Is there a WebService cache in Visual Studio I don't know about? I've cleaned, rebuilt, built the project, even searching the pro...

Dealing with WPF objects inside ViewModel

Using the MVVM pattern creating WPF applications you have the ViewModel providing data to the View. I've met a situation where I find it reasonable to create WPF objects in my ViewModel, and the View fetches these and shows them. More specifically I have functionality for drawing where I need to store an InkPresenter in the end. I receiv...

Print a BLOB document

Hello all, I am trying to find a way to print a document that is stored as a BLOB without having to first open it, the filename is stored as well so I have the extension of the file available. The only idea I have had is to save it in the users temporary folder and then point the PrintDocument class to it but im sure theres a better way...

Why .NET Remoting server can't send event to internet clients

Hello everyone, Like you know, .NET Remoting has some limits, one of them is that server can't send event to internet clients across NAT/firewall. This is an evidence: http://social.msdn.microsoft.com/forums/en-US/netfxremoting/thread/6a91626a-3c44-45a1-b0f8-dbf4042f51e4/ And today, I have a plan to improve .NET Remoting so that server...

Asp.net MVC with mysql

I am using ASP MVC to develop a new project. I am using the repository pattern for Data Access. I have worked on the same scenario before using SQL Server, but now I'm using MySQL. How do I interact with MySQL using the repository pattern? ...

How to update Properties of Uploaded Documents on Sharepoint using Web Services ?

I am trying to Update/Edit Properties of Uploaded Document on Sharepoint 2007. My code: Lists listService = new Lists(); listService.PreAuthenticate = true; listService.Credentials = new NetworkCredential(username,password); listService.Url = "http://myserver/SiteName/_vti_bin/lists.asmx"; string strBatch = "<...

convert string to DateTime in C#

i want to convert this string into DateTime. Tue Aug 19 15:05:05 +0000 2008 I have tried the following code, but not getting the proper value. string strDate = "Tue Aug 19 15:05:05 +0000 2008"; DateTime date; DateTime.Parse(strDate,out date); ...

What gets disposed when "using" keyword is used

Let's have an example: using (var someObject = new SomeObject()) { var someOtherObject = new SomeOtherObject(); someOtherObject.someMethod(); } SomeOtherObject also implements IDisposable. Will be SomeOtherObject also disposed when SomeObject get disposed ? What will happen to the SomeOtherObject ? (disposing of SomeOtherOb...

Import/Export CSV from SQLite from C# code

Hi, I am trying to figure out an eazy way to load CSV file into SQLite DB using System.Data.SQLite I saw commandline way to do that i.e .Import mydata.csv mytable But I need to do this via C# code. Any Idea? ...

fast sorting using .net 3.5 framework

Hello everybody In a scientific application I'm writing (vb.net) I use a huge collection of object stored in a tree structure. Every object exposes a LastAccessed property (datetime) that stores the last time the node was accessed by the algorithm. I need to find a fast way to find the N least accessed objects in the structure. I'm us...

WithEvents LinkedList is it Impossible?

What is the optimal approach to a WithEvents Collection - VB.NET? Have you any remarks on the code bellow (skipping the Nothing verifications)? The problem is when I obtain the LinkedListNode(Of Foo) in a For Each block I can set myNode.Value = something, and here is a handlers leak... -Could I override the FooCollection's GetEnumera...

Recreating a workflow instance with the same instance id

We have some objects that have an associated workflow instance. The objects are identified with a GUID, which is also the GUID of the workflow instance associated with the object. We need to restart (see NOTE 3 for the meaning of 'restart') the workflow instance if the workflow definition changed (there is no state in the workflow itself...

disabling namespace attributes in serialization

Am using following code to deserialize an object, using (MemoryStream memoryStream = new MemoryStream()) { try { XmlWriterSettings writerSettings1 = new XmlWriterSettings(); writerSettings1.CloseOutput = false; writerSettings1.Encoding = System.Text...