.net

.NET - Is it possible to write a DataTable directly to a SQL Database?

I'd like to do something like the following: Dim Conn as new SqlConnection(ConnectionString) MyDataTable.WriteToDB(Conn, "New Table") Are there any shortcuts like this built into .NET? Thanks ...

How do I write an exit handler for an F# application?

Subject says it all. I want some code to run if my application is terminated by, say, ^C. ...

What is the Difference in Managed and Unmanaged Code, Memory and Size?

After seeing and listening lot about Managed and Unmanaged Code , and knowing about the only difference is that Managed is about CLR and un-managed is out side of CLR, it makes me really curious to know in detail , what is it that all about Managed and Un-Managed Code,Memory and Size? How can a code I write in C# can be unmanaged while ...

Monitor.TryEnter Advice

Hello, We are using Parallel Extensions in one part of our vb.net app to retrieve an datatable from a dictonary(of string, datatable). In the method to retrive the table, we are using Monitor.TryEnter. Sometimes, we get the error "Object synchronization method was called from an unsynchronized block of code." Here is what our method lo...

How are elements stored in containers in .Net?

Hi How are elements stored in containers in .Net? For example, a C++ vector stores in sequential order, while List doesn't. How are they implemented for .Net containers (Array, ArrayList, ...)? Thanks. ...

Extract contract interface from a workflow service (WF 4.0)

Hi, I have a workflow service created with WF 4.0 and the need to have a typical WCF decorated interface extracted from it, containing all operations. I need it for testing purposes. Is there a way to extract a decorated interface from a workflow service? Thank you ...

LINQ to XML:Is XNode query possible

I want to use LINQ to XML in Silverlight 3 since there is no XPath support. I have kind of got the hang of it. But the project I'm working on will not guarantee that all the XML tags I will be querying for will appear in the result XML file. Due to this I will not be able to query the overall file as XDocument becase the absence of the ...

Microsoft Enterprise Library Useful or Not?

Hello all, I want to know about Microsoft Enterprise Library 5.0 . Can u plz tell me that , is it good to use various modules of that Enterprise Lib rather than developing our own modules for caching,encryption,data access,logging etc? I am a beginner to Microsoft Ent Lib and simply want to know how efficient or effective that Ent Lib...

Debugging both .net and stored procedure in VS 2008 together

I know we can debug the stored procedures in Visual Studio but is it possible to debug the .NET code and Stored Procedures together? I mean if my .NET code calls a stored procedure, whether my debugger will still continue with the stored procedure step by step. ...

UnauthorizedAccessException with System.IO.File.InternalCopy in ProgramData on Windows 7

I have a program installed in ProgramData. I use UAB 2.1 to updating app but it's failed because accessing to the path is denied (OK with text files so I think there's problem with UAC). How can I get overwriting rights in ProgramData/MyAppFolder or display a dialog to notice user give overwriting rights for updater. Many thanks in adva...

How can i connect remote sql server by Entity Framework?

Hello everybody. I have no enough experience on database systems. I have to connect to remote sql server and process some queries on it. How can i connect remote server by Entity Framework ? ...

ldap: how to get a list of all domain names

I am a newbie with LDAP. I am trying to list all the NT Domain names. By NT Domain names I mean, the names of domains you would find on the LAN Network. You can observe this on windows xp machines when you try to log-on to that machine (i.e. the log-on dialog you get after hitting ctrl+alt+del). Usually we select the domain name in the l...

how can i crop the pdf page in c#

hii, can any one help me that how can i cut the pdf page like as acrobat professional. regards, vipin katiyar ...

StaticResource Markup Extension vs. System.Windows.Application.FindResource

I've defined a BitmapImage in my ResourceDictionary like that: <BitmapImage x:Key="Skin_Image_Back" UriSource="./images/back.png" /> and loaded the ResourceDictionary like that var dict = Application.LoadComponent( new Uri("TestProject.DefaultStyle;component/Style.xaml", UriKind.Relative)) as ResourceDictionary; Application.Cur...

Could SynchronizationContext be used not in WinForms/WPF application?

I'm writing a component that would be used in WinForms or WPF applications also could be used in Windows services or Unit tests. Is there a way to use SynchronizationContext component in non UI apps? ...

Windows Server/.NET-based email dropbox implementation

We're developing a SaaS application, which, among other things, has to have email integration: whenever a user sends an email to a unique email address (such as [email protected]), our .NET service has to handle this message - pretty common nowadays, I guess. Before starting to design anything, I'd like to know what is the ap...

Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact

Hi, I have a .Net service that connects to an Oracle database on every request. It works fine at the beginning, but after some number of requests I start getting: Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection c...

What are lifted operators?

Hi, I was looking at this article and am struggling to follow the VB.NET example that explains lifted operators. There doesn't seem to be an equivalent C# example or tutorial. I don't have much experience with operator overloading in general, so trying to come to terms with the VB.NET equivalent whilst reading up on nullable types proba...

How do you profile a .net application taking into account the effect of the CPU cache?

All the .net profilers I know don’t take into the account the effect of the CPU cache. Given that reading a field from the CPU cache can be 100 faster than reading it from main memory, it can be a big factor. (I just had to explain this in an answer) I have seen too many people spend a long timer speeding up loops that a profiler sa...

OutOfMemoryException using BZip2 (SharpZipLib)

I use Asp.net , .net 3.5, win2003, iis 6.0. I use Oracle for gathering files, saving file in SharpZipLib.BZip2 compressed format in field RAW in table Oracle. My application is Web, and I use WCF Service for get data (array of bytes) of a file. The aspx page send file to user (download file). My issue-problem: I read DATA from Orac...