I am developing installer for a Application Suite using WIX, and the structure is
follows:
Application Core
|_ _ Flavor1
|_ _ Flavor2
|_ _ Flavor3
Application Core is a product like Visual Studio and, Flavors 1,2,3 are sub products under it.
Here is my problem,
- In Add remove programs should have 4 entries for Appl...
Possible Duplicate:
What is the C# Using block and why should I use it?
I have seen the using statement used in the middle of a codeblock what is the reason for this?
...
I'm wondering if there are any reasons (apart from tidying up source code) why developers use the "Remove Unused Usings" feature in Visual Studio 2008?
...
I've just installed resharper and it's letting me know the namespaces i'm not actually using in each of my classes.
which lead me to the question - is there actually any overhead in leaving these, unused, using declarations in?
is it just a matter of tight code, or is there a performance hit in invoking these namespaces when i don't ne...
Hi just to clairfy if I have the following:
using (Object1) {
create Object2
}
// bookmark1
Will Object2 be destroyed at bookmark1 along with Object1?
Object2 is of StringReader and Object1 is of MemoryStream.
...
Say I have these two objects:
OracleConnection connection = new OracleConnection(connectionString);
OracleCommand command = new OracleCommand(sql, connection);
To close the connection or Oracle, do I have to call command.Dispose(), connection.Dispose(), or both?
Is this good enough:
using(connection)
{
OracleDataReader reade...
Hello!
I am still learning C++ and I have never really created my own namespaces before. I was experimenting with them and while I got most things to work, there's one thing that I still can't seem to do. I would like to be able to call a static method within a class without typing something like "NameOfClass::method." Here is what I...
Would really like to be able to decorate my class with an attribute of some sort that would enforce the use of a using statement so that the class will always be safely disposed and avoid memory leaks. Anyone know of such a technique?
...
So a using statement automatically calls the dispose method on the object that is being "used", when the using block is exited, right?
But when is this necessary/beneficial?
For example let's say you have this method:
public void DoSomething()
{
using (Font font1 = new Font("Arial", 10.0f))
{
// Draw some text here
...
I'm adding some code into a using block in a C# program. I'm sort of stuffing my app, which previously was a standalone into an existing body of code, so I need to do a bit of messing around to get it to fit properly. What it's ending up looking like is the following:
public class WrapperForMyOldApp
{
public static ItemThatINeed ...
Hi,
I'm writing a C# program to get FoxPro database into datatable everything works except the memo field is blank or some strange character.
I'm using C# .Net 2.0.
I tried the code posted by Jonathan Demarks dated Jan 12. I am able to get the index but i don't know how to use this index to fetch the data from memo file.
Pleaese help m...
Hello,
I'm new to C#,been a pascal lover until I found C# in Depth.In Delphi there is a try{} statement that is also implemented in C#.
However,I've seen some of you mentioning "Using(){} is better than try{}".
Here's an example:
//This might throw an exception
sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, Pr...
I am wanting to create an internal messaging system that can tell me the duration of some code being called. I was thinking for ease of use, to make the SystemMessage class implement IDisposable.
I would set a time stamp during the SystemMessage's constructor and if the Dispose was called, I could figure out the duration.
The prob...
Can some body please tell me the way to access the google service such as the user feed items in google reader through the web application using username and password. I do not want the user to authenticate. I want the solution in ASP.net.
There is already a solution avaible in Python at http://dalelane.co.uk/blog/?p=303
But I do not ...
In MySQL, you can use the keyword USING in a join when you join on columns from different tables with the same name. For example, these queries yield the same result:
SELECT * FROM user INNER JOIN perm USING (uid)
SELECT * FROM user INNER JOIN perm ON user.uid = perm.uid
Is there an equivalent shortcut in SQL Server?
...
I have a dal layer with lots of methods, all of them call stored procedures, some return lists (so with a use of SqlDataReader), others only a specific value.
I have a helper method that creates the SqlCommand:
protected SqlCommand CreateSprocCommand(string name, bool includeReturn, SqlDbType returnType)
{
SqlConnectio...
If I have the following situation:
StreamWriter MySW = null;
try
{
Stream MyStream = new FileStream("asdf.txt");
MySW = new StreamWriter(MyStream);
MySW.Write("blah");
}
finally
{
if (MySW != null)
{
MySW.Flush();
MySW.Close();
MySW.Dispose();
}
}
Can I just call MySW.Dispose() and skip the Close ev...
DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods.
However, from what I've read so far, DataSet and DataTable don't actually have any unmanaged resources, so Dispose() doesn't actually do much.
Plus, I can't just use using(DataSet myDataSet...) because DataSet ha...
This might seem like a noddy question, but I was looking at this because I heard someone claiming that you must call Close() on a FileStream, even if it is in a using block (and they have code where Close() is being called right at the end of the block).
I know that Close() is meant to call Dispose(), but I thought I'd look deeper since...
I've run ildasm to find that this:
using(Simple simp = new Simple())
{
Console.WriteLine("here");
}
generates IL code that is equivalent to this:
Simple simp = new Simple();
try
{
Console.WriteLine("here");
}
finally
{
if(simp != null)
{
simp.Dispose();
...