I have this method declaration:
private SomeType getSomething<T>( T spec ) where T: String, MemoryStream
The compiler error I get is:
'string' is not a valid constraint. A type used as a constraint must be
an interface, a non-sealed class or a type parameter.
I don't understand what is...
more >>
Unable to Copy File
Posted by MAF at 1/19/2006 3:51:11 PM
Does anyone know why in 2005 I might be getting this error everytime I try
and recompile?
Error 226 Unable to copy file "obj\Debug\myfile.dll" to
"bin\Debug\myfile.dll". The process cannot access the file
'bin\Debug\myfile.dll' because it is being used by another process. myfile
...
more >>
getting client ip in sock-client on server
Posted by Ankit Aneja at 1/19/2006 3:47:36 PM
The code of classes given below is for server to which clients connect
i want to get ip address of client which has connected
pls help how can i get
//listen class
public class listen
{
TcpListener server=null;
Thread tcpthread=null;
client[] cl=new client[3];
public list...
more >>
Books, Atricles, Websites on Marshalling
Posted by bonk at 1/19/2006 3:45:20 PM
I am currently trying to write a longer article about Marshalling when
using [ImportDll]. Does anyone know books, articles, or websites that
cover Marshalling in Platform Invocation Services ([DllImport])?...
more >>
How do I wait until myVar == true
Posted by Coder at 1/19/2006 3:43:19 PM
Howdy everybody!
How do I do the following...
while (myVary != true){};
Obviously I do not want to use 100% of the processor to stay in this
infinite loop till myVar == true. But wait do I do?
Thanks yal!
- Coder ;)
...
more >>
System shutdown notification
Posted by VJ at 1/19/2006 3:31:23 PM
How do I bn a notification in my program that windows operating system is
shutting down or restarting?
VJ
...
more >>
propertygrid problem
Posted by Rainer Queck at 1/19/2006 3:16:41 PM
Hi NG,
I am using a propertygrid to show the properties of a class , which among
others holds a BitArray.
I can select and edit this BitArray property with the "boolean listings
editor" (might not be the exact name since I translated it from german) but
if I later reselect this property , ...
more >>
.NET Remoting DNS Caching problem?
Posted by Michael Bray at 1/19/2006 3:10:54 PM
Ok guys here's a tough one... I have a client/server application that
uses remoting for communication. I am using Activator.GetObject to create
a remoting instance with an URL that specifies the client machine by name.
The *application* server in this case is the *remoting* client. In oth...
more >>
() ?
Posted by Jarod at 1/19/2006 3:08:24 PM
Hey
Intelisense give me for example list of possible choices in functions and I
chose ToString but it doesn't add () so let's say it was object.ToString and
we always have to type this () maybe I am really lazy but is there a way to
update it to add this () ?
Jarod
...
more >>
snipet ?
Posted by Jarod at 1/19/2006 3:07:03 PM
Hey
In my intelisense ( VS 2005 ) , when I type for example foreach I have
selected in intelisense list snipet called foreach, how to chose it so it
will display the snippet ? I know there is a combination od Ctrl + K + X but
if intelisense displays me a snipet and it's selected maybe there i...
more >>
creating a dynamic if statement via reflection
Posted by Digital Fart at 1/19/2006 3:03:50 PM
I have 3 strings containing "10" , "20", ">="
would it be possible via reflection to generate a dynamic if statement
that return true or false and testing it like this
if ( 10 >= 20 )
so a string becomes a test of 2 integers
and how would i code this?...
more >>
GetRequestStream slows down?
Posted by Jim Toth at 1/19/2006 2:50:02 PM
I have a multithreaded application that is posting XML requests to a remote
web site. As more and more calls are made to
HttpWebRequest.GetRequestStream, the length of time increases for each call
from an initial 2-3 seconds to anywhere from 15-30 seconds. What am I doing
that is causing t...
more >>
Vb.Net to C# Conversion
Posted by Rajesh at 1/19/2006 2:30:50 PM
Hi guys,
It wil be very helpful if sumone could give me the pros and cons,Guidelines
or links for converting Vb.net projects to c#.
Regards
Rajesh
...
more >>
Multidimension Array in C# Windows Form
Posted by Jason Huang at 1/19/2006 2:30:30 PM
Hi,
I have a 2 dimension string array MyArray, how do I know the Count of the
Rows and Columns in the MyArray?
Thanks for help.
Jason
...
more >>
Need help on Regex
Posted by smileyjenny NO[at]SPAM gmail.com at 1/19/2006 2:27:36 PM
Hi,
I need to replace all spaces in a square bracket with understores.
Does anybody know the regular expression to do that? For example,
[Employee First Name] will become [Employee_First_Name].
Thanks in advance!!
...
more >>
How to create event templates using vs.net 2003
Posted by harish at 1/19/2006 2:17:17 PM
hello,
I am trying to write code for form activate event and for an event of an
object.
Generally, you select the object/form from the top combo box in visual
studio ide, and select the event you want to code for from the right combo
box... which would generate a template ready to write cod...
more >>
Highlight a PictureBox OnMouseEnter
Posted by Joe at 1/19/2006 2:04:11 PM
I have a PictureBox that we're using like a button. Is there a way to apply
a sort of highlighting to the image in the MouseEnter event?
I was thinking something like changing the color of all the pixels by a
slight factor.
Any suggestions?
-Joe
...
more >>
Generics and multi-level inheritance
Posted by Daniel Billingsley at 1/19/2006 1:52:40 PM
Let's say I have:
public class RootClass<T>
{
public virtual T GetOne()
{
return default(T);
}
}
and
public class MiddleClass<T> : RootClass<MiddleClass<T>>
{
// A bunch of additional functionality
}
and
public class ChildClass : MiddleClass<ChildClass>
...
more >>
Why does this compile?
Posted by tni NO[at]SPAM nc.rr.com at 1/19/2006 1:39:20 PM
int x = 0; int y = 0; int z = 0;
try
{
z = x / y;
}
catch (Exception) // THIS IS NOT A (DECLARATION)!!!!
{
}
Thomas
...
more >>
Duplicating Tabs
Posted by RobKinney1 at 1/19/2006 1:36:03 PM
Here is a head scratcher:
I have 2 tab controls, upper and lower. LowerTabControl must be an exact
duplicate of UpperTabControl only with selected tabs from the upper.
For instance, I may want to duplicate tabPage1 and tabPage3 from upper and
project them to the lower.
Is there a way t...
more >>
ANN: Doc-O-Matic 5 released - Documentation System
Posted by Markus Spoettl (toolsfactory) at 1/19/2006 1:22:22 PM
Quick Link: http://www.doc-o-matic.com
http://www.doc-o-matic.com/download.shtml
RENO, Nevada, -- JANUARY 2006 -- toolsfactory announces the
release of Doc-O-Matic 5, a major new version of its popular
documentation system. Doc-O-Matic 5 comes with an exciting array
of new features such as Qu...
more >>
How do I do a SendMessage like operation in C#
Posted by chris.dannemiller NO[at]SPAM gmail.com at 1/19/2006 1:11:16 PM
In VC++ When I wanted to send a message to a window from a worker
thread I would use SendMessage. Events only work Semi-well in C#
becuase certain GUI operations require they run in the same thread that
the window exists in. Such as displaying a balloon on the tray. Does
anyone know a good way t...
more >>
Programmatic set GridView1 SelectedIndexChanged
Posted by Netmonster at 1/19/2006 12:33:42 PM
I am having trouble programmatically setting the SelectedIndexChanged
of a GridView.
Code as follows.
Panel Panel1 = new Panel();
GridView g = new GridView();
ObjectDataSource o = new ObjectDataSource();
//load objectdatasource using webservice
o.SelectMethod ...
more >>
MessageBox shuts down program
Posted by brianbasquille NO[at]SPAM gmail.com at 1/19/2006 12:01:39 PM
Hello all,
Any reason why a program would simply shut down when a
MessageBox.Show() is issued?
Strange behaviour as the MessageBox never actually pops up.. but
running through the debugger shows it fails and shuts down at the line
when the MessageBox.Show() is issued.
Bear in mind i am w...
more >>
Overlapping Regex matches
Posted by Jim_Kanepele NO[at]SPAM yahoo.com at 1/19/2006 11:38:43 AM
I have been looking for this all day and night.
Am I right to say this is not possible with Regex?
Example input string: NVNVNNRVN
I'd like to match all NVN occurrences.
NVNVNNRVN
match 1: NVN
match 2: NVN
(overlaps here)
Thanks for your help.
Bes...
more >>
list item deleted event?
Posted by Alex K. at 1/19/2006 11:26:04 AM
Hi all
How do I catch an event when list item is deleted from ListBox?
Is there such event?
Thank you
Alex...
more >>
Novice: SecurityException on TableAdapter.Fill()?
Posted by Peter at 1/19/2006 11:20:01 AM
Hello,
Thanks for reviewing my question. This is my first program with the new VS
2005 and I created a simple dialog with a datagrid connected to a new
database I created with VS as well.
this.sampleTableAdapter.Fill(this.sampleDataSet1.Teams);
Error Message:
System.Security.Securit...
more >>
What is wrong with debugger?
Posted by Brett Romero at 1/19/2006 10:52:36 AM
I have a line of code that references a method in a .NET DLL. I can
usually debug into this DLL and step through the method. With a recent
update of the DLL (from some one else), I can't step into this method.
I hit the line in my app, try to step into it and the debugger seems to
go into the ...
more >>
Best way to save a datatable into SQL server
Posted by John at 1/19/2006 10:44:44 AM
Hi,
I have a datatable object in memory, the datasource is not from SQL server.
I want to save this datatable into SQL server 2000, what is the best way to
do it?
The only way I know is to create table dynamically then loop thru datatable
generate and execute an insert statement per row....
more >>
Static Method Question
Posted by Doug Handler at 1/19/2006 10:19:41 AM
I have a static method that needs to assign a type to an instance of an
object. What's the best way to address this?
e.g.
private Panel pnlMain = new Panel();
.....
public static void SetControl(Button btnInfo)
{
// pseudo-code - I need this to happen here - how can I do this. ...
more >>
mod_rewrite
Posted by beachboy at 1/19/2006 10:03:20 AM
Do dotnet have a module as apache's mod_rewrite??
if yes, will server performance downgrade??
Thanks in advanced.
...
more >>
Replace, Left, Right functions in C#
Posted by Ed Chiu at 1/19/2006 10:00:06 AM
Hi,
Does C# has functions such as replace, left, right, substring for strings?
Without these functions, it's not easy to process strings.
TIA ...
more >>
foreach or List.ForEach
Posted by Tripper at 1/19/2006 9:24:02 AM
Which is the better way to go and why?
//trivial example
List<string> strings = GetStrings();
foreach (string s in strings)
{
// some operation;
}
strings.ForEach(
delegate(string s)
{
// some operation
}
);...
more >>
Directory.Exists
Posted by Phil Barber at 1/19/2006 9:10:34 AM
using ASP.NET 1.1
int PID=(int)Session["PID"];
string FilePath=PF.GetProjectPath(PID);
if(!Directory.Exists(FilePath))
Directory.CreateDirectory(FilePath);
the Directory.Exists always returns false even though the Directory does in
fact exist.
note the FilePath string is a UNC path ...
more >>
Button FlatStyle params in .NET 1.1
Posted by Janiek Buysrogge at 1/19/2006 9:00:38 AM
Hi,
Is there a way to achieve the same looks for a flatstyle button in
..NET 1.1 as is done in .NET 2.0 with these properties:
FlatAppearance.BorderSize = 0;
FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transp...
more >>
Which PInvokes aren't supported in C# or managed code?
Posted by Scottie_do at 1/19/2006 8:42:05 AM
I've heard from the CDO team that managed code is unsupported. With a site
like www.pinvoke.net it's possible that I'll easily end up with a faulty
application architecture that will require a rewrite after I write the darn
thing.
I would like to know what are the circumstances that make i...
more >>
Deployment nightmares with app.config
Posted by Keith Elder at 1/19/2006 8:27:20 AM
Let's say you have a stand alone C# library project that is your
datalayer. When this library compiles it will produce
"My.DataLayer.dll" for example.
In the project you use all the new whizbang DataSet generation tools to
create some datasets, etc in your DataLayer project. When you setu...
more >>
Release Compling & References
Posted by Steve B. at 1/19/2006 7:58:04 AM
I have a ADO.Net Library project (adonet.dll) in my VS solution
Recently, when I Debug comple I don't get any errrors. When I Release
compile to my local share network drive the compiler says it can't find the
library project namespace (I build he library first)
When I add the project ref...
more >>
Application settings--form location and size
Posted by David Veeneman at 1/19/2006 7:53:51 AM
I'm having a problem getting design-time property binding to work with a
form's size and location properties.
I started with the Location property under Application Settings in the
Properties window. I added a new setting ("FormLocation") using the New
Application Setting dialog, and confir...
more >>
Delegate / Multi-User Control Question
Posted by Doug Handler at 1/19/2006 7:28:12 AM
Hi,
I have a form (Form1) that contains a tab control which one tab has a
customer user control (UserControl1). When the user double-clicks on the
grid hosted there a new user control is created. I have a delegate / event
that passes via EventArgs the appropriate info from the grid to the
...
more >>
How to get a sinlge value from a dataview?
Posted by timpera2501 at 1/19/2006 6:39:02 AM
Hi,
I'm a bit new to C# and .NET and I'm struggling to find the right syntax for
my problem.
I am trying to figure out how to get a single value from a view? Row 0,
Column 0 (the view has only one result anyway). I know how to get this from
a dataset, but the syntax is not the same for...
more >>
Create View on MS SQL-Server 2005 with C#
Posted by Karsten at 1/19/2006 5:13:39 AM
Hi,
I want to create dynamic reports with C# and MS SQL-Server 2005
Reporting Services.
Since the reporting service uses a data-table or data-view, I want to
create a view dynamically.
How can I create a data-view on a MS SQL-Server 2005 with C#?
Thanks for your help!
Karsten
...
more >>
environment
Posted by Tim at 1/19/2006 4:56:11 AM
There is a vb6 standard exe. This exe makes calls to other Com dlls and dot
Net dlls and exes. In this scenario, is the application running in the dot
net environment or com environment? ...
more >>
Cast between a function pointer and IntPtr
Posted by Abra at 1/19/2006 3:52:34 AM
I have an application where I need to send a inter-process message (a
data stream) that contains among other the address of a function (member
of a class).
For that, I need to serialize it, so I tried to cast it to an IntPtr,
but without success. And of course, on the receiever side, I need to
...
more >>
marshal binary data file, written with C++, with my C# code
Posted by Vertilka at 1/19/2006 3:32:33 AM
I need to read binary data file written by C++ program, using my C#
application.
How do i marshal the bytes i read with my C# code to .NET types.
The data is numbers (integers float doubles etc..) and strings.
I looked at the Marshal class but did not know how to use it with file.
Please ad...
more >>
ListView Header Height
Posted by Brian Keating at 1/19/2006 3:20:03 AM
Hi there,
Does anyone know how to make the header height of a ListView bigger?
Should i set font or something ,
any ideas appreciated.
Thanks
Brian...
more >>
Insert text into an ASPx page
Posted by Martin at 1/19/2006 3:17:03 AM
Hi
New to the .NET framework, but have been on 2124C, and have come back to
work to be asked to do ADO and ASPx (not covered in course!). The probelm i
am having is that I have created an ASPx page with some text in, and need to
add a block of text at a particular place from a database table...
more >>
Experts - Very strange - Focus from one object to another
Posted by Gidi at 1/19/2006 2:33:05 AM
Hi,
I've a strange problem in my form. I have a textBox which i want to get the
focus when the form is loaded, so i gave it TabIndex=1 and on the load method
i wrote textBox1.Focus(). I have two more dataGrids which i was able to move
from one to another by clicking Enter, then i wanted to ...
more >>
Reorder English text?
Posted by Asaf at 1/19/2006 1:41:02 AM
Hi,
Below is a calss with function I gathered from a news group that uses
GetCharacterPlacement API to reorder text.
I have mixed text Hebrew/English and the function reorders the Hebrew text.
I would like to reorder the English text instead the Hebrew text.
How can I do that please?
...
more >>
Create SID?
Posted by anders NO[at]SPAM aleborg.se at 1/19/2006 12:52:02 AM
Hi!
To create a new Windows account I use this code:
const int UF_PASSWD_CANT_CHANGE = 0x0040;
const int UF_DONT_EXPIRE_PASSWD = 0x10000;
DirectoryEntry obDirEntry = new DirectoryEntry("WinNT://" + domain);
DirectoryEntries entries = obDirEntry.Children;
DirectoryEntry obUser = entrie...
more >>
about locating assemblies
Posted by Shiraz at 1/19/2006 12:35:04 AM
Hi
It seems like none of the old posts get any follow up after a few messages,
whether or not something constructive comes out of them, so I'm left with no
choice but to repost an earlier question I asked. Below I've copy-pasted the
log of the last post. It's an interesting problem, and it ...
more >>