all groups > c# > july 2005
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Create Generic Collection at Runtime
Posted by Paul Welter at 7/31/2005 9:56:33 PM
Is there anyway to do the following?
Type myType = typeof(User);
Collection<myType> list = new Collection<myType>();
I know I could just use User instead of myType but have a function that
takes a type and populates a collection then calls SetValue using
reflection. How would I create th... more >>
c# - Interlocked.Exchange and value types
Posted by steve at 7/31/2005 9:08:09 PM
// What I want to do
Use enumerated types with the Interlocked.Exchange methods
Suggestions please
// My estimation of problem
Seems like Interlocked.Exchange only works with ints, referencable objects,
and floats
// Background
I have a class that wraps up a worker thread to handle... more >>
I need a trigger
Posted by hourlie at 7/31/2005 9:00:03 PM
I wrote a simple Web Service. It Consumes a single String, writes it to a
text file on the hard drive, and returns a success. Now I need a trigger
that will start the program that processes the file.
I could make a routine that checks for new files every so many seconds, but
that uses to... more >>
RegisterWindowMessage
Posted by Dave at 7/31/2005 8:55:29 PM
Hi,
I am sending windoew message from a c# application to c++(unmanage)
application using this code
System.UInt32 rm= RegisterWindowMessage("12345");
System.IntPtr ptr=(IntPtr)HWND_BROADCAST;
PostMessage(ptr,(int)rm,5,5);
PostMessage(ptr,WM_AAA,5,5);
but the c++(vc-6 mfc) dont catch t... more >>
Hashtable.. design question.
Posted by Naveen Mukkelli at 7/31/2005 8:20:01 PM
Hi,
I'm designing an server application. Eventhough, in the first release, a
few
hundred clients will be connecting to this server, later on few thousands
of clients
will connect.
Currently, I'm thinking to use a Hashtable to store various clents and their
Information. Howeve... more >>
Incorrect syntax near the keyword 'DEFAULT'
Posted by Mark Findlay at 7/31/2005 7:51:04 PM
Hello Experts!
I am attempting to use the OleDbCommand.ExecuteScaler() function within my
ASP.NET C# web page to perform a simple validation, but receive the
following error:
"Incorrect syntax near the keyword 'DEFAULT'"
The form has 2 fields on it, called tb_username and tb_password. (... more >>
Looking for a free windows text editor, for c#
Posted by Javaman59 at 7/31/2005 7:41:02 PM
Although I mostly use the Visual Studio IDE, and recommend it, from time to
time I prefer to knock out a small app with just the command line, and a text
editor.
Until recently I've used VIM in a unix terminal, for c++, but that is no
longer available to me, and, AFIK, doesn't support c#.
... more >>
1 tab control, 5 tab pages - different color
Posted by Martha at 7/31/2005 6:52:06 PM
I have one tab control with 5 tab pages.
I want to color each tab page a different color.
Does anyone know how to color the entire tab page a unique color?
(that includes the tab part of the tab page)
In other words, just like different paper folders come in different colors,
how do you prog... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
General Question about Main() and forms etc
Posted by Charlie Tame at 7/31/2005 6:17:46 PM
Definitely a newcomer to C# (in fact to any programming after some years
away) and I'm finding lots of examples but they are sometimes confusing.
My concept of (say) QuickBasic was that you write a main program that calls
subroutines, thus breaking the thing up into manageable parts.
I sta... more >>
convert to double
Posted by chris at 7/31/2005 4:06:01 PM
Hi there,
I have a function which converts a calculation into double
dr[i] = Convert.ToDouble (tbl.Rows[0][i], provider) / campCustomers * 100;
The returned value looks like this:
0.0132622796653082877191290300
I would like that this value is format to show only the last two decimals ... more >>
When I set the location property for a control, stack overflows
Posted by Will Pittenger at 7/31/2005 1:11:57 PM
I have a Control derived class. When the parent of the control changes the
control's Location property, the stack overflows. I have not found a way to
find out what was on the stack when it does overflow. All I know is that
the program is either stopped due to an exception at the end of Mai... more >>
Declare public variable in C#1
Posted by MMSJED at 7/31/2005 12:37:02 PM
I am beginner in using C#, actually I am trying to move from VB6 to C#
I need very small maybe you will laugh when you get it that simply I have 2
forms let’s say Form1 (main form) and Form2 and there is parameter in form2 I
have to call from form1.
So please would you tell me how?
What... more >>
Declare public variable in C#
Posted by MMSJED at 7/31/2005 11:57:02 AM
I am beginner in using C#, actually I am trying to move from VB6 to C#
I need very small help in programming problem my be you will laugh when you
get it
That simply I have to form let’s say Form1 (main form) and Form2, there is
parameter in form2 I have to called from form1.
So please woul... more >>
ListBox Transfer Sample Code
Posted by Sivana at 7/31/2005 11:40:03 AM
Hey,
Does anyone have any sample code where I can transfer list items between two
list boxes. C# and WinForms.
Thanks
... more >>
SQL tables/fields to classes/properties
Posted by Sehboo at 7/31/2005 9:06:05 AM
Hi,
I have several tables on SQL Server. Is possible that instead of
manually creating all these classes (where each table is represented by
a class and each field on the table is represented by a property in the
class), I can run some wizard which create all these
classes/properties? Any f... more >>
How to port a TCP based Java application to C# ?
Posted by yaron at 7/31/2005 6:37:02 AM
Hi,
1. i can't use .net remoting because the new .net ported app have to
communicate with the java app. (so i have to use sockets and TCPListener ? )
2. does the JLCA (java to c# convertor) does all the work for me ?
Thanks.
... more >>
Questions about aspx pages and frames
Posted by stevag at 7/31/2005 12:00:00 AM
Hello,
1) I have an .html page that hosts 2 frames, each of which hosts a
different .aspx page with C#. What I would like to do is place a
RadioButtonList control with two options on the first frame . Based on
the option that the users chooses , I want to activate different
functional... more >>
Saving Dataview to a Dataset
Posted by Dennis at 7/31/2005 12:00:00 AM
Hi, I am hoping I can get some help with a small problem I have run
into using C#. U have an XML file that I load into a Dataset and then
display this in a Datagrid. No problems doing this at all. I then use
a Dataview to filter this view using a keyword and I have no problems
with this either.
... more >>
After using HOOK to catch the KeyPress message,is it possible to modify the content of the message?
Posted by ½£¾ªºè at 7/31/2005 12:00:00 AM
Give an example:When user pressed "B" or "b",HOOK get that message and let
TextBox1.text display "a".
The executing founction is as following:
****************************************
IntPtr MyHookProc(int code, IntPtr wparam, IntPtr lparam)
{
if( code < 0 ) return CallNextHookEx(_nex... more >>
Dataset Problem
Posted by Robert Clark at 7/31/2005 12:00:00 AM
I have a simple windows app. It consists of 2 forms. The first is used to
view the contents of a dataset, the second is used to update the dataset and
add/remove items from it. The problem is, when i add or remove items from
the dataset, it doesn't update the dataset until i restart the app... more >>
C# 2.0 Masked Text Box and Validating E-mails
Posted by orekinbck NO[at]SPAM yahoo.com.au at 7/30/2005 11:14:00 PM
Hi There
I have spent alot of time trying to get a masked text box to validate
e-mails, but with no success. Mainly because I can't figure out how to
account for the wide variety of different e-mail addresses, for
example:
billwallis@hta.com
bill.wallis@hta.com
billwallis@hta.com.au
bi... more >>
Compiling html dynamically
Posted by Kishore at 7/30/2005 10:58:03 PM
Hello,
Is it possible to generate a CHM file dynamically, from an html file or a
word document, through code. I searched on the net, but could not find any
answers.
I would like to generate a help file, for a particluar form/page on the fly.
Any help is greatly appreciated.
Thanking you ... more >>
FileSystemWatcher issue
Posted by John Lee at 7/30/2005 10:31:54 PM
Hi,
I developed a filewatcher service to monitor file creation on a network
drive - 90% time it works fine and from time to time I found out that the
newly created file on that network drive does not trigger the event - all I
have to do is to restart the service.
I kind of suspect the re... more >>
image manipulation
Posted by Telmo Costa at 7/30/2005 7:43:35 PM
Hi.
I'm trying to load an image and copy it to an array of bytes.
The image is a png 32bit format. The code I have is:
-------------------------------------------------------------
public void LoadImage(path) {
Bitmap image = new Bitmap(path);
byte[] pixels = new byte[image.Width*image.Hei... more >>
A Bug in Math.IEERemainder?
Posted by Sunny S at 7/30/2005 7:08:49 PM
Hi,
When calculating a remainder, R, as a result of X / Y, you wouldn't expect R
to be greater than Y, right? Wrong!
Math.IEEERemainder( double.MaxValue, 1000.0 ) returns 1.99584030953472E+292.
I understand why and how this happens, but the point is that returning a
value that is... more >>
Arrays and OutOfMemoryException
Posted by Fernando Casero at 7/30/2005 6:49:30 PM
Hi, I'm programming on Visual C# Express Beta 2 and I have the following
code:
class MyClass
{
int[] a = new int[30]
int [,] b = new int[10,20]
public int SomeMethod()
}
class OtherClass
{
MyClass[] cls = null;
public void DoSomething()
{
int a =... more >>
byte array to string
Posted by realgeek NO[at]SPAM gmail.com at 7/30/2005 6:47:52 PM
I have a byte array with binary data and I want to get its contants
into a string.
tagContent = System.Text.Encoding.ASCII.GetString(str);
screws binary data.
foreach (byte b in str)
{
tagContent += (char)b;
}
is damn slow.
What's the correct way to do this?
... more >>
dot net on linux
Posted by Baghdadi at 7/30/2005 3:21:01 PM
is there any dot net frame work for linux ??
or a developement platform for .net under linux ??... more >>
application without the graphic inteface
Posted by Baghdadi at 7/30/2005 2:09:02 PM
how can I run an application without a graphic interface , I mean an
application that works in the background licke the msn messenger , I know
that I can hide the window form , but that makes the program very slow !!... more >>
pulling an unknown string from the middle of two knowns
Posted by hourlie at 7/30/2005 1:38:01 PM
I have a string...
abcdefghijklmnop
I know the 'abcdefg' and i know the 'jklmnop', but I dont know the >hi<.
How do I assign this >hi< to a string so that I can play with it later?
... more >>
equivalent C# for VB.NET "Session"
Posted by dale zhang at 7/30/2005 11:43:02 AM
Hi groups,
Can anyone give me the equivalent C# sharp code for this VB.ET code,
:: VB.NET ::
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) _
Handles MyBase.Load
'This event routine in the loginCheck user control fires when... more >>
Load a URL's execution result
Posted by stevag at 7/30/2005 10:38:45 AM
Hello,
I am developing an application whose main goal is to read from a dynamic
..asp Internet URL. This URL automatically produces an RSS file, which I
further want to load into my application so as to manilupate the source
and render the results into an HTML page using ASP.NET and C#.
My pr... more >>
keeping memory resources cleaned up within timer loop of Windows Service
Posted by hazz at 7/30/2005 9:22:40 AM
given
namespace WindowsService1
{
public class Service1 : System.ServiceProcess.ServiceBase.........
private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
ArrayList myAL = new ArrayList();
CustomClass objCont = new ControllerClass;
CustomClass objInfo ... more >>
Transmitting a 'char' array thru serial port in new C# 2005 Expres
Posted by halukg at 7/30/2005 6:52:17 AM
I am trying to send a 6 byte char array from the serial port in new C# 2005
Express:
com.Write(new string(new char[] { (char)34, (char)14, (char)192, (char)51,
(char)0, (char)0 }, 0, 6));
I am receiving 34,14,63,51,0,0 from the port as I connected Tx and Rx pins
to each other by using the ... more >>
Naming Conventions for Enumerations
Posted by orekinbck NO[at]SPAM yahoo.com.au at 7/30/2005 4:45:31 AM
Hi There
What convention do you use when naming an enumeration and variables
that use the enumeration?
I like plural/singular, for example:
public class Example
{
public enum VehicleTypes { Car, Truck, Motorbike };
static VehicleTypes VehicleType = VehicleTypes.C... more >>
Compression in .NET 2.0
Posted by orekinbck NO[at]SPAM yahoo.com.au at 7/30/2005 2:59:29 AM
Hi There
Is there any easy way to use the System.Compression tools in .NET 2.0
to compress an entire directory ?
All my source code is kept in a single directory so I have written a
utility that recursively backs up the directory and compresses each
file as it goes. The utility has no GUI... more >>
simple out parameter as ArrayList
Posted by andrewcw at 7/29/2005 11:05:01 PM
Why is it that I get these errors on this function
1.) The out parameter 'Avalues' must be assigned to before control leaves
the current method
2.) Use of unassigned local variable 'Avalues'
public bool getStringFieldAsArrayList( out ArrayList Avalues)
{
bool retVal=false ;
Avalues.Add... more >>
Where does DragDrop event come from???
Posted by Dan at 7/29/2005 10:20:55 PM
How do I find out what control a DragDrop event comes from? I initially
presumed that it was the "sender" parameter. But this always seems to be
the destination.
Ie ...
private void listviewMonday_DragDrop (object sender,
System.Windows.Forms.DragEventArgs e)
{
// "sender" always se... more >>
BASIC interpreter source in C#
Posted by scott_hutter NO[at]SPAM yahoo.com at 7/29/2005 9:00:40 PM
Hello, Im in need of a BASIC interpreter source code in C#. If anyone
can point me to something like this, it would be appreciated.
... more >>
display one string and store another in same combobox item
Posted by VMI at 7/29/2005 5:59:26 PM
Is it possible to display something in a combobox and store something else?
For example, can I display "Query for active employees" and save the actual
query in the same combobox item? That way I can automatically retrieve the
specific query for the option the user chose.
Is this possible... more >>
public function from class in other namespace inaccessible
Posted by Peter Speybrouck at 7/29/2005 5:29:03 PM
I have a little problem with a webservice. I reproduced the problem in the
following simplified example.
I just create a new C# ASP.NET webservice and a c# console application.
I added a new class test to the namespace of the webservice which I try to
access from the console
application.
... more >>
Best Way to Learn C#
Posted by robbiebell22 at 7/29/2005 4:50:01 PM
I have been looking all over the internet on how to learn C# .net. I have
read a couple of books, lots of forums, and tutorials, but i am still at a
very big loss as far as trying to write my own GUI Windows application. I
was just wondering how everyone one learns C# so well that they progr... more >>
Dynamic asp form via cs (c#) code
Posted by dpfollmer NO[at]SPAM yahoo.com at 7/29/2005 2:03:32 PM
I am currently designing a ASP.NET form for contacts which displays a
picture depending on which contact is being viewed. This code works
perfectly thus far, but I want to add an if-case for when the picture
does not exist.
In english it would be something like this:
If file exists ("..... more >>
C# Process.Start (applications return code to OS)
Posted by Tony at 7/29/2005 1:24:23 PM
I am running an application called AcroComm.exe to poll time clocks here at
our company. I have written a small C# app that will poll the clocks based
on information found in a DB. My problem is that AcroComm will sometimes
stop polling in the middle of the process and terminate. The programing
... more >>
Sharing classes
Posted by dbcuser NO[at]SPAM gmail.com at 7/29/2005 12:42:36 PM
Hi All,
This is a very simple question. I have a proxy class (for web service)
and couple of other classes that are common for 3 of my projects. As a
developer, I would like to keep these common classes seperatly and use
them in three different projects. How can I do that?
Thanks.
... more >>
public static enum?
Posted by jim at 7/29/2005 12:33:35 PM
I have a configuration class which a handful of enum's that I want to
access from another assembly/project. Is this possible?
... more >>
Which Microsoft Visual Studio .NET to go with?
Posted by wASP at 7/29/2005 11:43:45 AM
Hi,
I am contemplating the purchase of Microsoft Visual Studio .NET,
and I've noticed that the prices range anywhere from $200 to $600 USD:
<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>-<+>
http://www.calibex.com/Microsoft-Visual-Studio-NET--zz57175175z0znz1zvisual
_st... more >>
Form1_SizeChanged .....Maximize minimize events cannot capture
Posted by JJ at 7/29/2005 11:29:44 AM
I have athe following code, but nothing happens when I minimize or maximze
the form using "top right corner minimze/maximize buttons". What am I
missing!!!!! Help please!!!!!!!!!!
Thanks
JJ
private void Form1_SizeChanged(object sender, System.EventArgs e)
{
if(this.WindowState == ... more >>
SoundCard/Modem
Posted by Sahil Malik [MVP] at 7/29/2005 11:22:28 AM
A really simple question.
I have an interactive application that works using a microphone and speakers
plugged into the sound card.
I'd like this app to work over a telephone now. VOIP or a real telephone
line - both are workable options.
I am clueless how to proceed further, this was d... more >>
form1_Sizechanged (maximize/minimize ???)
Posted by JJ at 7/29/2005 10:53:53 AM
I have athe following code, but nothing happens when I minimize or maximze
the form using "top right corner minimze/maximize icons". What am I
missing!!!!! Help please!!!!!!!!!!
Thanks
JJ
private void Form1_SizeChanged(object sender, System.EventArgs e)
{
if(this.WindowState == Fo... more >>
|