.net

ComboBox.DataSource assignment taking ages

I have the following code: List<string> list = SomeFunction(); this.myComboBox.DataSource = list; For some reason, the assignment to DataSource is taking a surprising amount of time (about 1.4 seconds), when the list only contains 4 items. Any idea why this is? Edit: SomeFunction() looks in several folders on disk for the existenc...

why dispose method is not for string object?

why dispose method is not for string object in c#? As we know Dispose() is the method for dispose the object. But why it is not allows for string object or integer object? Edited: What does the mean of managed object ?. Please guide me. ...

Tricky questions and answers on oops and C# or dotnet

Hi guys, I am facing the interviews, always getting new things. But I want to know what are the most tricky question based on OOPS, C# and dot net with there answer. May be this thread will helpful to all who really willing to get knowledge. ...

I Need Help Deploying a Winform Application Using Setup Project

When a user click the .msi, i want a folder called "Your Files", which comes with two small images by default, to be created in C:\Users\YourName\Documents. In short, MyDocuments. What i did is put the following code in program.cs: string myDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string downloadAr...

filter to reverse anti-alias effects

I have bitmaps of lines and text that have anti-alias applied to them. I want to develop a filter that removes tha anti-alias affect. I'm looking for ideas on how to go about doing that, so to start I need to understand how anti-alias algorithms work. Are there any good links, or even code out there? ...

Is it possible to create an app in VB6 that read/writes to a database hosted on a web server?

I was just wondering if it's possible to create an app that interacts with a database hosted on a web server... or is it only possible using VB.NET? Also if it is possible, is there any good documentation or tutorials I could reference? ...

What are the wrong assumption in .NET while developement?

Hi, Many times developers have poor knowledge about the concepts, but they intent to develop such concepts in programming. What are the common wrong assumptions by developers and what are correct? In .NET. ...

Weird behavior of VS toolbox

I want to configure the Visual Studio toolbox each time the user switches between documents in the editor. For that purpose I implemented an add-in with the following method, which is called upon activation of a document window: private void ConfigureToolbox() { EnvDTE.ToolBoxTab myTab = GetTab("My Tab"); // fix for VS bug (see...

OPC sample application for C#

Does anyone know a C# OPC client sample application? I'm looking for a good opensource one to learn about the protocol. I would prefer it if it uses OPC foundation .net core apis. ...

Monodevelop Proxy Settings

How do I set the proxy settings of Monodevelop? I tried to modify the Monodevelop.exe.config with the following code <system.net> <defaultProxy useDefaultCredentials="true"> <proxy proxyaddress = "http://172.0.0.18:8080" bypassonlocal = "true"/> </defaultProxy> </system.net> ...

C# Attributes mandatory property.

Hello, I've created attribute like [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] [Serializable] public class TestPropertyAttribute : System.Attribute { public string Name { get { return _name; } set { _name = value; } }string _name; } and I should ma...

how to access defines and structs inside a .h from C#/.NET?

In accessing PDH.dll (a Win32 API) (see link) using P/Invoke, it turns out that I need access to several constants and structs. I found these are defined inside a file PDH.h. How do I access these defines and structs? Do I have to rewrite them with C#? Is there another way? ...

Why I am not able to make a connection to a sql server 2008 via sqlcinet in .net but with oledb I can?

Hi , I have a windows 2008 r2 x64 enterprise edition + sql server 2008 r2 datacenter edition from its local computer I can make connection to the sql server with sqlClient in C# and here is my connection string looks like : using (sqlconnection cn = new sqlconnection("Data Source=myServerIPAddress;Initial Catalog=myDataBase;User Id=myUs...

Email in vb.net

I need to send an email from vb.net What is wrong with this code? Dim nc As New Net.NetworkCredential("username", "password") Dim sc As Net.Mail.SmtpClient Dim strServer As String strServer = "mail.btinternet.com" sc= New Net.Mail.SmtpClient(strServer) sc.EnableSsl = False sc.Credentials = nc sc.UseDefaultCredentials = False sc.Send("...

NServicebus added to legacy windows service

I have a simple class which sets up NserviceBus for a legacy windows service. This configuration is called when the service starts up. When I run the application as a console app the configuration in the App.config is picked up, however when running the application as a windows service the App.config configuration isn't picked up. Is ...

Launching a Silverlight App from a desktop app and vice versa

I have been asked to investigate the possibility of launching our companies current desktop app from a silverlight app we may develop. Would it be possible to launch a desktop app from a silverlight app (both in browser and out of browser) and vice versa, i.e. launch the silverlight OOB app from the winforms desktop app? If so, how would...

Consuming a secure WSE2.0 / .Net 1.1 WebService using .Net 3.5 and VS 2008.

Please forgive any mistakes in this question. I am not overly familiar with secure web services or WCF. I need to consume a web service that uses WSE 2.0 and .Net 1.1. The service is secured in two ways. An X509Certificate and a BinarySecurityToken added to the header. I have code samples as to how to consume this Web Service when usi...

How to add code-behind code to umbraco templates?

Hello, I am getting started with umbraco 4.5.2. I have my site up and running, and I am designing templates using some ASP.NET controls. How can I respond to events from these controls? For example, I have added a Button to a template. How can I edit the code-behind file to perform some action whenever the button is clicked? Thank you...

Pros and Cons of using ASP.NET MVC with Entity Framework?

What are some pros and cons of using ASP.NET MVC with Entity Framework in .NET 4.0? Any 'gotchas' in live scenarios? ...

Text file , CVS xml or what are my options ?

I want to develop an app for Windows 7 phone. It will be a GRE vocab app. i dont want to use SQL CE, my app will have 3 tables conceptually. I will be using Linq to SQL to querying data. Now i am confuse how should i store data so it is easy for retrival and update. XML , CSV , XML or any other format ? ...