Hi,
I'm writing a class-library in VB.Net and one of the subs that are being called from the application which is using my library has more or less the following syntax:
Public Sub LoadDict(ByVal PhoneticType As String, ByVal strDict As String)
where PhoneticType can be phonSoundex, phonDoubleMetaphone or noPhonetic
I want to give t...
I can never remember all the rules for implementing the IDisposable interface, so I tried to come up with a base class that takes care of all of this and makes IDisposable easy to implement. I just wanted to hear your opinion if this implementation is ok as it is or whether you see something I could improve. The user of this base class i...
I need to integrate some legacy 32-bit code - for which I don't have the source code, into a project in such a way that it can be called from a 64-bit .NET assembly. The original code is implemented as a 32-bit COM object in a DLL. Windows doesn't allow direct calls from 64 to 32-bit objects, so I'm looking for inspiration on how to deal...
I love LINQ to SQL but it has been bugging me that in using it, my repository code becomes generated by the LINQ to SQL framework and hence tightly coupled to an SQL Server database.
Are any of you using LINQ to SQL in an abstracted, loosely coupled fashion and if so, how did you approach the problem of keeping your code database-indepe...
How does performance for reading/adding values from/to Dictionary(Of String, SomeReferenceType) depend on the number of records already entered? I mean, does time increase as O(1), O(log n), O(n) when n goes to be large, or in some other way?
Dim index As New Dictionary(Of String, SomeReferenceType)
' N entries added in a loop
' ...
D...
Hi,
I know what I asking might not make a lot of sense for C# experts but I'll explain what I want to do and then you can suggest me how to do it in a better way if you want ok?
I have a C# class called DatabaseManager that deals with different MySQL queries (ado.net NET connector, not linq or any kind of ActiveRecord-ish library).
I ...
using (var file_stream = File.Create("users.xml"))
{
var serializer = new XmlSerializer(typeof(PasswordManager));
serializer.Serialize(file_stream, this);
file_stream.Close();
}
Using the above code works perfectly. However, when I shorten it to:
var serializer = new...
i am trying to send the value id inorder to connect 2 pages. the search page with the comments page.
this is the error i get
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code
Exception D...
I have a small application that takes screen shots and saves them to the folder its in. It works fine most of the time, but in some cases, for example while in Team Fortress 2 or while running Warcraft 3 in OpenGL mode it just returns a totally black(or white) image. Does anyone have a way to fix this?
I am using the c# standard:
Bitma...
I'm reading about connection pooling in .net and i'm not sure if i'm getting it right. They say that a closed connection is returned to the pool so that it can be reused later. But what is the pool associated with? Is it a database or just the application environment (computer it is executed on)? If it's the latter, then if you have two ...
I want to find the area/s in a video that have a certain colour. C# would be preferable Java is possible.
For example I have a feed from a web cam and I want to know what region of the live picture has the colour red.
I have looked at the Aforge.net library but cant see which part might be appropriate.
Any suggestions?
...
Hello,
Q1
FormsAuthentication.CookieDomain property specifies the domain for which this cookie is valid. Overriding this property is useful if you want to enable the cookie to be used for more applications on your web server
A) I assume the quote is suggesting that if same browser is used to log onto two web applications, then...
I was reading a forum recently, and saw this comment:
So, you see you've been duped into
believing that the 'using' syntax is
going to help clean up your resources
for you. Oh well, welcome to .NET
development.
This has really freaked me out! I use using almost exclusively over .Dispose() in nearly all cases (streams espe...
Lets suppose that I have the following simple query
var q =
from p in products
orderby p.ProductName descending
select p;
What would be the simplest and most straightforward way to specify the sort field and direction at runtime?
...
I have seen following type of scenario in some websites..can anybody help me when do we use this type scenario exactly...?
class emp
{
public void add()
{
MessageBox.Show("Emp class");
}
}
class dept : emp
{
public void disp()
{
MessageBox.Show("dept class");
}
}
emp ee = new dept();
I just w...
Hi there,
If I have the report name how can I programmatically get the name of the project/folder the report is in?
So for example if I have a report like so
http://server/Reports/Pages/Report.aspx?ItemPath=/ReportProject1/ReportName
Given "ReportName" how can I figure out that the report is in the folder "ReportProject1"?
So I gues...
We have SOAP implementations of our services and up till now we had some legacy code that was wrapping our args and returns in another object to get around some serialization / generics on RPC methods.
After optimization, we had implemented this class so that it Json serialized (DataContractJsonSerializer) and GZipped our complex reques...
Whats the best way to go about modifying a C++ program to be used with pInvoke from C#.NET CF?
I have a large C++ codebase which makes extensive use of STL. Namely iterators, container classes, and standard strings.
On top of this many lightweight classes are passed around by value.
I want to build a C# gui ontop of this codebase for ...
I'm writing a custom tracelistener to write trace messages to a file adding rotation (for example changing the file name each day).
In the override of the Flush method, I call Flush on the underlying StreamWriter, but if I set autoflush='false' in the application configuration, Flush does not get called when the application is terminated...
For our winforms application, we've been asked to colour invalid cells in a DataGridView in a red colour. We need to find a red colour that matches the current visual style but which is still distinctive if the user has chosen a palette with mostly reds. How do I create a colour that will match the current visual style? How do I make ...