.net

How to determine if an event is already subscribed

Hi, In my .NET application I am subscribing to events from another class. The subscription is conditional. I am subscribing to events when the control is visible and de-subscribing it when it become invisible. However in some conditions I do not want to de-subscribe the event even if the control is not visible as I want the result of an...

.NET allocations profiling

I need a way to track all allocations in a .NET application that happen during a single step in the process of debugging my application. I mean, when I'm in the debugger, stepping through code, I would like to see for a single step what allocation took place. Is there a tool or a way to do it? I tried several memory profilers including C...

Missing parameter error after running MySql query

Hello, I'm completely new to MySql and haven't used SqlDataSource with UpdateParameters before, so I'm probably missing something very obvious. When trying to update a record, the update does happen but then throws an error saying "'id' parameter is missing at the statement". So the query works and the database gets updated as it shoul...

how to get the duration of an audio file after uploading using FFMPEG

Hi Team, I am uploading audio files in asp.net using FFMPEG.My question is how can i get the duration of the file(in seconds). Please suggest me. Thanks and Regards Srinivas M ...

Sitecore - Rich Text Editor field is not saving information but instead just copying old information back to the field.

We are using Sitecore.NET 5.3.1 (rev. 071114) and we found out a problem. When we are trying to change information in a Rich Text Editor field on the Master database and save the information, this information is not stored and instead the old information appears back into the RTE field. I have been trying this on the Web database on whic...

How can I use generic here.

I am trying to use generic for the first time and trying to typecast my result returned from database to programmer defined data type. How can I do this. dsb.ExecuteQuery("DELETE FROM CurrencyMaster WHERE CurrencyMasterId=" + returnValueFromGrid<int>(getSelectedRowIndex(), "CurrencyMasterId")); private T returnValueFromGrid<T>(...

How to create file of files?

class Node { FooType Data; // I can save Data to file with extension .foo void Save() { // save Data to .foo file } } Now , class Graph { List<Node> Nodes; void Save() { foreach(Node node in Nodes) { node.Save(); } } } Now when I invoke someGraph.Save(); the...

how to get inbox mails in listview using vb.net?

I'm trying to collect (yahoo,gmail,hotmail etc.,)inbox mails uding vb.net? i tried this using tcpclient, First i got the tcpclient connection,and get response data from server for (gmail --host--> "pop.gmail.com") got response like "+OK Gpop ready for requests from 122.174.183.249 b15pf3378725rvn.27" second,i'm ...

[.NET][C#] - Is possible to get a web with its links (CSS,JavaScript,Images, CSS-Images) ?

Hi there, I am implementing a CMS, the case is that the "Web-Editable" is in a different domain thus, I would be able just get the page using HttpRequest in order to copy and show it in the CMS server to make it able to change it (DOM just visual purpose) and save the changes to the CSS and JavaScript folder on the "Web-Editable" using ...

A good UI design for rating in .Net

Hi, im trying to add a "rating" system to an existing form (i.e 1 star, 2 Star or poor, average,good,excellent etc). Does anyone know of a way to achieve this that is aesthetically pleasing with good UX either in .Net or a free 3rd party control? Thanks ...

Locking behaviour is different via network shares

I have been trying to lock a file so that other cloned services cannot access the file. I then read the file, and then move the file when finished. The Move is allowed by using FileShare.Delete. However in later testing, we found that this approach does not work if we are looking at a network share. I appreciate my approach may not have...

How can i add a new Function or Property on textbox class's text property

I want to add one more function/property to a text property of a textbox like this. txtControl.Text.IsEmpty(); or txtControl.Text.IsEmpty; which returns me bool value. I dont want to compare for empty string every time. i.e. if(txtControl.text==string.Empty) {} else {} Can we do some other way also if just want to do it like if(tx...

lambda expression based reflection vs normal reflection

What is the difference between normal reflection and the reflection that can be done with lambda expressions such as this (taken form build your own MVVM): public void NotifyOfPropertyChange<TProperty>(Expression<Func<TProperty>> property) { var lambda = (LambdaExpression)property; MemberExpression memberExpression; if (lamb...

Why is it not possible to call RegFree COM and .NET from the VB IDE (VB6 & VBA)?

Hi I have an example project with works when called from compiled VB6 but not from the IDE or from Excel's VBE. There are 3 DLLs QA.DLL, QB.DLL, QAW.DLL. QA is written in C#.NET, QB and QAW are written in VB6. QAW is a COM wrapper of QA. In the calling code I create an Activation Context and load a manifest file. All works fine from...

Since upgrading a website from ASP.NET 3.5 to ASP.NET 4.0 my dates come out in US format

Since upgrading a website from ASP.NET 3.5 to ASP.NET 4.0 my dates come out in US format, ie 3/24/2010. How can I change it back to UK format (24/3/2010) for all pages on my site? Is there a default setting somewhere? ...

Problems using FluentNHibernate + SQLite with .NET4?

I have a WPF application running with VS2010 .Net3.5 using Nhibernate with FluentNHibernate + SQLite, and all works fine. Now I want to change to use .Net4, but this has turned into a more painful experience then I expected.. When setting up the connection I do this: var cfg = Fluently.Configure(). Database(SQLiteConfiguration.St...

SOAP and NHibernate Session in C#

In a set of SOAP web services the user is authenticated with custom SOAP header (username/password). Each time the user call a WS the following Auth method is called to authenticate and retrieve User object from NHibernate session: [...] public Services : Base { private User user; [...] public string myWS(string username, s...

Is it possible to reference the Azure SDK 1.1 Microsoft.WindowsAzure.* assemblies from a .NET 4.0 Client Profile project?

I have a WPF application targetting the .NET 4.0 Client Profile which needs to use the Microsoft.WindowsAzure.* assemblies provided in the Windows Azure SDK 1.1. The problem is that these assemblies have a runtime version of v2.0.50727. I am able to add references to them from my WPF project but they're not recognised. I've read about ...

Firing PropertyChanged event in a complex, nested type in WPF

I have a class called DataStore and a list of Departments (an ObservableCollection), and each department again has a list of Products. Properties in the Product class that are changed also affect properties in the Department and DataStore class. How does each Product notify the Department it belongs to, and the DataStore (which is the mo...

Include a unique URL in EXE

Hi :) I want to give users of my site the ability to upload their software/hardware configuration automatically on Windows. So I'm thinking of having an EXE file download, and somehow put in that EXE a unique URL for each user. When the data is collected, the program would just posts some JSON to that URL. How can I do it? I'm most fami...