Visual C#
Recent update: 2008-3-21

Does C# provide any unique identifier function?

101 byte By Rosemary at 2008-3-7
Does C# provide any function which will create and return unique identifier? Thanks,

How can I make the IDE create correct code?

2743 byte By KevinShan at 2008-3-7
I implement a component, but I can't get it's paraent (a control which contain the component).So I want to get the paraent from constructor's parameter.But the IDE can't create corrent code for my new constructor.How can I make the IDE create correct code?I want to let the IDE automatic ...

how to make an installation file for my written program in c#

129 byte By musichenryviolin at 2008-3-7
hi all, the question as the title please help me to solve this anyone can give me a flavour thanks henry

Referencing Value Variables

2560 byte By JimStapleton at 2008-3-6
I want to do something where I can take any variable, reference type (no problem) or value, and have a reference to the data, rather than just the data (in the case of value variables). Example: //create three objects for reference object obj1, obj2, obj3; //create two value variables and one ...

The IDE often automatically changes the file subtype from "Form" to "Code" i

276 byte By WilfredTang at 2008-3-6
The IDE often automatically changes the file subtype from "Form" to "Code" in the .csproj file, which renders the forms unviewable in design view until that change is undone. Is there any way to prevent the IDE from doing this automatically? Thanks, Wilfred

how to make a installation file in c#

129 byte By musichenryviolin at 2008-3-6
hi all, the question as the title please help me to solve this anyone can give me a flavour thanks henry

Dispose() and null

708 byte By zheny.lu at 2008-3-5
If I call the "Dispose" method on an object, would it be equal to null? And If I make the object equal to null instead, would it be same as calling "Dispose" method of the object?For example:SomeObject obj1 = SomeObject();SomeObject obj2 = SomeObject();obj1.Dispose();obj2 = ...

Make a file 'DependentUpon' via the IDE

162 byte By kk302999 at 2008-3-5
Easy question, I can modify a C# project using notepad to make a file DependentUpon another file, but is there a way to do this in the IDE? Thanks

VS2005 Image Library Gone!

293 byte By LeeHambley at 2008-3-5
Hey fellas, I've got the beta2 Team system thing, - nearly had a heart attack watching the MSDN.TV thing regarding the image library.. but my install didn't include it for some reason, and ideas or suggestions why - it's not somet silly like an extra download from somehwere on msdn is it ?

Please tell me what is IOperationInvoker in WCF and the situation where we impl

104 byte By prem at 2008-3-5
Please tell me what is IOperationInvoker in WCF and the situation where we implement this interface

'out' vs. 'ref'

74 byte By serghio at 2008-3-3
is there some sample, where can to see the diference between both?

Multifile Assemblies?

168 byte By Dpowers at 2008-3-3
How do i add a static member using the class view...this static method should be named Add() that returns an int value and accepts two int parameters first and second?

Anyone know Accountability pattern?

128 byte By erdsah88 at 2008-3-3
Does anybody have an idea about accountability pattern from martin fowler. We have problem figuring out the database schema.

using as operator

56 byte By serghio at 2008-3-1
I can use as opertator, for the objets that I created?.

How can I cover the menu item's shortcut?

515 byte By TomChen at 2008-3-1
Supposed I have a form with KeyPreview=true and a menu item whose shortcut is CTRL+C. Add a Textbox on the form. When I select some text in the Textbox and press CTRL+C, the selected text just can not be copied because system just call the menu item's OnClick event handler.And then how can I ...

How C# talk with Flash Communiaction Server

136 byte By c#crack at 2008-3-1
Hi buddies, do any body gone through, how C# communicates with Flash Communication Server? any idea.. please help.. thanks, Vinu

single instance of form

758 byte By johnk at 2008-2-28
hello,currently i have forms that are selected from a menu but multiple instances seem to be allowed. i would like to have only a single instance of each form allowed, but would like the user to be able to recall the form again after closing the form. other threads on this topic have code that ...

name for button does not change in click event

892 byte By TienTran at 2008-2-28
I have 2 buttons name btnHonda and btnToyota, but the click event clicks show:private void button1_Click(object sender, EventArgs e) { } private void btnToyota_Click(object sender, EventArgs e) { }button1_Click should be btnHonda_click .....is this a bug with Visual C# 2005? ...

DataGridView new row

151 byte By DavidA.Coursey at 2008-2-28
Why when I add a new row to a DataGridView do all the textboxes show (null)? How do I make it so that these are just empty textboxes? Thanks dave

Compare two word files and show the place where there is a change.

106 byte By sn at 2008-2-28
I want to compare two word files and if they are different i need to highlight the place where it differs.

IEnumerable<T> problem

1184 byte By TreyNash at 2008-2-27
Can someone, for the life of me, explain why this code won't compile with CS0305 as the compiler error?Thanks very much, -Trey-using System;using System.Collections.Generic; public class MyContainer<T> : IEnumerable<T>{ public void Add( T item ) { impl.Add( item ); } public void ...

Build Web Comments Page

201 byte By xgbnow at 2008-2-27
Does anyone know what happen to the "Build Web Comments Page" function that used to be under the Tools menu in VS 2003? It does not appear to be an option in VS 2005? Thanks for the help in advance.

serialPort Questions

1676 byte By SmileyMicros at 2008-2-27
I tried unsuccessfully to use the DataReceived event to read data from the serial port. It gives a thread exception and I cannot figure out what the error message is trying to tell me. So I put a button on the form and added: private void button2_Click(object sender, EventArgs e){ while ...

I want to see System.Diagnostics.Debug output in DebugView even when debugging i

1048 byte By guest at 2008-2-27
First, the DebugView program can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb896647.aspxThis is the tool of choice for viewing output from System.Diagnostics.Debug.Write("message"); If you build a program that has these write calls in debug mode, and then run it di...

CS0309: constraint has been violated. (possible bug?)

1479 byte By JoeR at 2008-2-26
Does anyone know why the following doesn't work?interface B is derrived from interface A, and should contain an implicit conversion from B to Aerror CS0309: The type 'constraint_bug.interface_b<T>' must be convertible to ...

Line length

234 byte By knallbunt at 2008-2-26
Hi, I can't find the option to set the maximum line length and display the print margin. I would also like to know if the auto-formatter automatically reorganizes the code so it doesn't exceed the line length? Can someone help?

How to invoke a form class from different NameSpace?

897 byte By Chakravarthy at 2008-2-26
Hi, I have a situation with multiprojects created using VS IDE with different namespaces as mentioned here. I first created a windows application with the name App1 and i created another new project with name App2 and added to the exisiting project. ie., App1 Now, all i want is how can i ...

Problem with sorting a generic List

2269 byte By DeKale at 2008-2-25
The new generics in C# 2.0 are really breath taking, but I've got some problems with sorting a Generic List. I've got a List<KeyValueType<TKey, TValue>>, so this is a list containing another generic type. Now I would like to sort this list by the TKey type of the ...

Missing editor (I think !) for solution properties

722 byte By TimFells at 2008-2-25
Hi ! I am new to C# (and programming generally) but I enjoyed working with C# Express 2005 Beta 1, and made some dlls for some software I already have. This required using the properties interface to build and debug.I recently installed Beta 2. The compiler works fine, but when I click the ...

file upload user control

723 byte By ppl1 at 2008-2-25
well...i created a user control - <form id="Form1" encType="multipart/form-data" runat="server"> <table> <tr><td><input id="filename" type="file" name="filename" runat="server"></td> </tr> <tr><td><input id="uploadBtn" type="button" ...

Why is it called C#?

97 byte By BubbaDuck at 2008-2-25
C++ is the next iteration of C, hence "C++" But why did they call the next one C#??

Generics And Interfaces....

1662 byte By DarrenBlackett at 2008-2-24
I'm currently trying to use generics to make my interfaces a little bit more flexible. Unfortunately I seem to have hit a problem with the compiler complaining when I try to use an interface as an input parameter, if that interface requires a type to be defined. I'm not sure if I explained ...

Interface code completion using C# vs.2003. . .

451 byte By BlairStark at 2008-2-24
sometimes when I inherit an interface I get the tool tip asking me to hit tab to implement. But other times I dont. Sometimes when I dont get the tool tip I erase the inherited interface and replace and I get the tool tip. the behavior is erratic and makes no sense. Any Ideas?is there a ...

User name missing after product activation

454 byte By PhilipKing at 2008-2-24
Can anyone tell me how to add my user name to a Visual Studio Express product after activating the product?For example, in Visual C# 2005 Express Edition Beta 2, when I select 'Help' from the Menu bar and choose 'About ...' in the upper-left corner it says: Licensed to: Unknown User Name.I ...

Creating instance of Generic type using parametised constructor

1465 byte By DaveWaterworth at 2008-2-23
Hi,Why does the code below not work? I've constrained the T type of the Bar class to be a "Foo" but I still get compiler error "Error 1 'T': cannot provide arguments when creating an instance of a variable type" (beta 2 - 8.0.50215.44). Since I've constrained T to be a class rather than ...

Snippet behavior in C# Express

850 byte By LTR at 2008-2-23
I am new to C# Express and can't seem to get the snippets to work in files that are part of a project. If I open a .cs file by itself, that is, not as part of a project, then the snippets work fine. However, if I open the same file as part of a project, then the snippets won't work.Let's say ...

vs 2005 B2 compile error

2668 byte By ThisBytes5 at 2008-2-23
This may not be the best group to ask in as the question is about the beta, if there is a better place please point me to it. I've had beta 1 installed, after a re-install of the OS this weekend I installed beta 2. I opened a project that I had written with beta 1 and tried to compile it, ...

From C to unsafe C#

114 byte By Me-myself-I at 2008-2-22
Hi Peter, Thanks for responding. Converting to string doesn't help me convert the code unfortunately. Thanks!

stop build not available?

228 byte By thomaswoelfer at 2008-2-22
is it just me, or is the 'stop build' button not enabled for cs project builds? incase it is - does anybody know if this is supposed to stay that way in the final? WM_THX thomas woelfer http://www.die.de/blog

Generic: open constructed type vs. instance type

765 byte By Smarty at 2008-2-22
On the one hand:Given the generic class declarationclass List<T> {...}some examples of constructed types are List<T>, List<int> and List<List<string>>.A constructed type that uses one or more type parameters, such as List<T>, is called an open constructed ...

Difference Between C#.Net and C++.Net

315 byte By doug5516 at 2008-2-22
Can someone tell me the primary differences between C#.Net and C++.Net? If I learn one, will I necessarily be learning the other? Which one would you recommend that I learn first? Currently, I know C++ but I program professionally in VB6. I am looking to make the transition into the Visual ...

Provide strings to localize in a text file

641 byte By NicolasGallerand at 2008-2-22
I am actualy testing C# in VS2005 and i compare fonctionalities with C++ that i used in VC2003. I found that in a C# project, there is no property pages for files like in a C++ project. I used the property page in C++ project to perform custom build : compile a text file to resource using ...

StreamReader and File Position

3968 byte By ThomasD.Greer at 2008-2-22
I'm processing large binary files. These are PCL files, and I'm looking for page boundaries. I want to store the position of each Form Feed, which in PCL is decimal 12, hex 0C. However, that byte can also exist as part of a raster or other binary structure.So I loop through the file, and when ...

Question: Generic methods should provide type parameter

1092 byte By bzurer at 2008-2-21
"Generic methods should provide type parameter" http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.32&url=/Design/GenericMethodsShouldProvideTypeParameter.html public sealed class ReflectionAgent{ public static T GetCustomAttribute<T>(MemberInfo memberInfo) { if (memberInfo ...

Visual C# Express Edition Beta 2 and SQL Server Express Beta 2

621 byte By Marianeel at 2008-2-21
I tried to connect the SQL server express from C# Express beta 2 and got some error.In the "Add Connection" Dialog the options I gave are:Data source: SQL server DatabaseDatabase file name: C:\Program Files\Microsoft Sql Server\MSSQL.1\MSSQL\Data\tempdb.mdf Is it right? else What to give ...

How to invoke Windows Forms from Different project created Using VS?

897 byte By Chakravarthy at 2008-2-21
Hi, I have a situation with multiprojects created using VS IDE with different namespaces as mentioned here. I first created a windows application with the name App1 and i created another new project with name App2 and added to the exisiting project. ie., App1 Now, all i want is how can i ...

Format the checkBox Glyph with an image of 25x25

270 byte By psp at 2008-2-21
Hi, I need create a CheckBox control .In this I want the checkBox Glyph with an image of 25x25 over it and the text should be displayed as it is,The behavior of the CheckBox control should be as microsoft check box control. So how to format the checkbox glyph???

I don't understand this code.

1303 byte By MikeF at 2008-2-20
I have a question about a line of code. I was looking at some code on how to implement ftp in .net 2.0 and saw this line of code.response = (FtpWebResponse)request.GetResponse(); my question is, why is FtpWebResponse in parenthisies?Usually you only see parenthisies when you use a method and ...

ConfigurationManager.AppSettings["KEYNAME"] is Null

450 byte By RyanKelley at 2008-2-20
I have tried every thread that I could find on search and have found no solutions for this yet.What I have is a very simple console application that is testing a BatchQueue from the CSLA Framework.When i make calls to ...

How to invoke the Windows Form from different Project?

897 byte By Chakravarthy at 2008-2-20
Hi, I have a situation with multiprojects created using VS IDE with different namespaces as mentioned here. I first created a windows application with the name App1 and i created another new project with name App2 and added to the exisiting project. ie., App1 Now, all i want is how can i ...