.net

How do I access a <form> that is not the master page <form>?

Winforms developer converting to web developer. I know the part about the Master Page having the tag, what is not clear is if I can or can not have another in one of my content pages. I have been seeing both answers doing searches. I see yes you can if only one has runat=server. The thing is I have a that contains several radio button...

AppDomain.CurrentDomain.UnhandledException doesn't always fire up

I encountered an exception in our application that isn't handled at all. I really don't know what to look for to debug this problem since the application close immediately when this peculiar exception is thrown (even running from VS). The exception handling is setup that way: [STAThread] [LoaderOptimizationAttribute(LoaderOptimization.M...

How to recover messages from Transactional Dead Letter Queue

I am using .net 3.5 and we have few of the message which went into DeadLetterQueue because of the MessageExpiry. I am using QueueExplorer and when looking at the message it has some extra character and some of the characters are deleted from the message. Any idea why it would done that and how to get the message back in the right forma...

Entity Framework UpdateException relationships in Added and Deleted states

Hi, I have a table of Plants and Information. Plants have an ID, Name, ..., MainInformationID Information have an ID, Title, ..., PlantID One plant can have many information, but only one MainInformation. Information can only have one plant. I have a class ViewModel which contains observable collections of plants and information whi...

Microsoft Outlook interop throws COMException (0x84130003)

I can't seem to find a thing on what this exception code indicates on Google or MSDN, and it's occurring intermittently and without a pattern I can discern. Has anyone run across this before? The failure seems to occur on the final line here: Dim olApp As New Outlook.Application Dim olNS As Outlook.NameSpace = olApp.GetNamespace("MAPI")...

Some questions about ASP.Net Postback

Hello, Lets say I have a text box which should have a default value.... and it is in an initializing function like so: void InitializeControls() { myTextBox.Text = "Default Text"; } Now, lets say that I have a button, which does a postback... I want to save the user entered value of the textbox off somewhere in the button's OnCl...

Getting started with Exchange Web Services 2010

I've been tasked with writing a SOAP web-service in .Net to be middleware between EWS2010 and an application server that previously used WebDAV to connect to Exchange. (As I understand it, WebDAV is going away with EWS2010, so the application server will no longer be able to connect as it previously did, and it is exponentially harder to...

SQL Query: How to determine "Seen during N hour" if given two DateTime time stamps?

Hello all. I'm writing a statistics based application off a SQLite database. There is a table which records when users Login and Logout (SessionStart, SessionEnd DateTimes). What i'm looking for is a query that can show what hours user have been logged in, in sort of a line graph way- so between the hours of 12:00 and 1:00AM there we...

How can I find out if an instance is a MarshalByRef proxy?

I know there's a way, I know I've done it (a long time) before, but I can't remember or find out how to do it!!! var otherDomain = AppDomain.Create("Lol my memory sucks"); var myRemotableType = typeof(MyTypeThatExtendsMBRO); var proxy = otherDomain .CreateInstanceAndUnwrap( type.Assembly.FullName, type.FullName); // how...

Combined SOAP/JSON/XML in WCF, using UriTemplate

I'm trying to build a generic web service interface using WCF, to allow 3rd party developers to hook into our software. After much struggling and reading (this question helped a lot), I finally got SOAP, JSON and XML (POX) working together. To simplify, here's my code (to make this example simple, I'm not using interfaces -- I did try t...

Optimize inserts

Hi! I did an importer in VB .Net witch get data from an SQLServer an inserts this data throught ADSL connection in a remote MySQL server. in the first time, it was like 200 records, but now there are more than 500.000 records and it expends like 11hours exporting all the data and that is bad, veryyy bad. I need to optimize my importer,...

How to take a collection of bytes and pull typed values out of it?

Say I have a collection of bytes var bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; and I want to pull out a defined value from the bytes as a managed type, e.g. a ushort. What is a simple way to define what types reside at what location in the collection and pull out those values? One (ugly) way is to use System.BitConverter and a Que...

How to get index using LINQ?

Given a datasource like that: var c = new Car[] { new Car{ Color="Blue", Price=28000}, new Car{ Color="Red", Price=54000}, new Car{ Color="Pink", Price=9999}, // .. }; How can I find the index of the first car satisfying a certain condition with LINQ? EDIT: I could think of something like this but it looks horrible: int fir...

Help with my application please! Can’t open image(s) with error: External component has thrown an exception…

I have an application written in C# I believe and it adds images to a SQL Server 2005 Database. It requires .NET 3.5 to be installed on my computer. I installed .NET 3.5 and setup a database. It runs fine but then once it gets to image 100 when running on one computer, It stops and gives me this error: Can't open image(s) with error: Ext...

How do i pass null into stdin like this perl code?

This is my question and apparently this is the answer. Turns out it was a buffer problem (solution in the accepted answer of my ffmpeg link) not stdin. I found you can stdout to null by writing > NUL in command prompt so i tried writing < NUL at the end of my argument. No luck. How do i pass in null or do something with the IO locks li...

How to achieve syncronization in loadbalanced multiserver environment

Hi, I have to create a .net web application which would run on more than one front end server which are load balanced. Now I have to use some third party api which is not thread safe so only one thread should call the API at a time so I have to use some syncronization machanism like lock or mutex which provide syncronisation within the p...

Using WPF and SlimDx (DirectX 10/11)

I am using SlimDX with WinForms for a while now, but want to make the switch to WPF now. However, I can't figure out how to get DX10/11 working with WPF. The February release of SlimDX provides a WPF example, which only works with DX 9 though. I found the following solution: http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/437/Dire...

Is there a connection method for DB2 to use "TrustedConnection"

I am from a MSSQL Server background and tried to search to see if there was a way to perform a trusted connection in DB2 similar to how you do that in MSSQL? I basically do not want to have a user name and password in the connection string and have the "runas" user have that information. Thank you for any help! UPDATED .NET with the IB...

Sync Between Providers With Different Identities Using Sync Framework

Hello, I'm trying to use Sync Framework to synchronize user data between Active Directory and an application that provides a web service. I've created two FullEnumerationSimpleSyncProvider classes, one for Active Directory and one for the web service, and created a common data type and metadata columns that can be shared by both. Curren...

Is it ok to reference .Net assemblies liberally?

I'm building a WPF application and working with the MVVM pattern. I have 4 projects in my solution, 3 class libraries, Data, Model and ViewModel and the WPF executable View. Is there anything wrong with the Model referencing WindowsBase so that I can use ObservableCollection<T> for example or can I just make use of what I intuitively f...