all groups > c# > april 2005 > threads for tuesday april 26
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
Question from a transforming VB guy on Global Variable
Posted by Scott Durrett at 4/26/2005 11:50:14 PM
I know and have been told that global variables are "bad". I must say that
I agree but what's the alternative to this?
1. I have an application that logs into a website. The site returns me a
sessionID and I must use this sessionID throughout the remainder of my
application.
I'm just ... more >>
Class Library Help PLz
Posted by MikeY at 4/26/2005 11:36:45 PM
Hi everyone,
I am trying to learn how to use dynamic controls with/by calling a class
library that contains the properties that will set them. Send/called from
the main form. I am using windows forms, C#. The two codes for the two forms
are as follows:
>>frmMain.cs<< Calling form
usin... more >>
about try and catch
Posted by BC at 4/26/2005 9:14:18 PM
Hi all,
I have a method that accepts a string as the parameter. This can be a
base64 image string, or just a normal string. Currently to test whether
it's a image string or just a normal string, I used try and catch:
private void MyMethod(string str){
try{
// If not exception is cought,... more >>
reading textfile
Posted by chris at 4/26/2005 8:38:02 PM
Hi there,
I am reading in a textfile which looks like this (there is no new line after
the last number)
03 98661881
0407 566453
The code to load the textfile looks like this:
System.IO.Stream sio;
sio = fDocument.PostedFile.InputStream;
StreamReader sr = new StreamReader(sio);
str... more >>
Binding To Object
Posted by bud at 4/26/2005 8:11:03 PM
I have a class named MyMessage with 3 properties DateReceived, From, HasRead
When i bind this do a datagrid for example all works well but I do not want
HasRead to be bound to the grid. I can just hide it in the grid but it seems
to me that there has to be some way to mark it in the MyMessag... more >>
Scope of an event handler?
Posted by Robert W. at 4/26/2005 7:40:03 PM
I'm in the process of defining a very complex data model that consists of
dozens & dozens of properties. To keep things better organized I've decided
to embed some classes within the main class, such as this:
public class MainClass
{
public class SubClass
{
.
.
This wor... more >>
language selection on day one
Posted by - HAL9000 at 4/26/2005 5:52:37 PM
Hello,
Background:
I am familiar with VB.NET, vanilla C++, and Pascal but not Csharp.
Please confirm/comment:
If I want to get a windows application running quickly (and minimize
total effort), and have the eventual goal of porting back to MFC (that
is, no .NET requirement), should I write... more >>
OnPaint over controls
Posted by Dan Baker at 4/26/2005 5:28:33 PM
I have a form with several controls. I would like to paint *over* several
controls (mainly GroupBoxes and Labels). But, Everywhere I try to perform
painting, I end up "behind" the controls. I need a device context for the
entire form, that I can render to *after* all the controls have been
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
ErrorProvider tooltip display problem
Posted by OShell77 at 4/26/2005 5:02:04 PM
Hi,
I have problem with a C# Win Forms app that uses the ErrorProvider class to
provide input validation feedback to the user. On my development workstation
(WinXP Pro + Visual Studio .NET 2003), when I run the app by itself or from
VS in debug, everything works fine... the ErrorProvider to... more >>
EnlistmentNotification Problems !!
Posted by Sahil Malik [MVP] at 4/26/2005 4:55:26 PM
Okay, so here is my EnlistmentNotification class - this is the class that
implements both ISinglePhaseNotification and IEnlistmentNotification (for
non distri and distributed transactions involving non durable or more than
one RM).
Funny thing though, while in a single RM scenario, public void... more >>
Best Practice for Uploading to SQL Server?
Posted by The Oracle at 4/26/2005 4:38:06 PM
Hi there,
I have an ArrayList containing approximately 20,000 database INSERT
command objects. Each of these commands needs to be executed. The commands
do not need to be executed in any particular order, nor do they need to be
part of a transaction.
I'm currently accomplishing t... more >>
Localizing attributes in properties
Posted by Steve Teeples at 4/26/2005 4:38:04 PM
I have placed text within a resouce file.
The class has a reference to a Resource Manager LocRM created in the
constructor. I want to reference the text within the resource file when
declaring a property. See below.
[Description(this.LocRM.GetText("strTestCategoryID")),
Category(TestCas... more >>
RegEx: Adding an "OR" condition to an existing expression
Posted by Guadala Harry at 4/26/2005 4:12:17 PM
The following function, SplitTheString(), splits a string based on a flag
that is like this:
{Flag1:whateverHere}
Note that the "whateverHere" part can be any character - and at least one
character.
I simply want to extend this RegEx to do the same job - but to do it based
on an additiona... more >>
regex replace all non numerics with blank???
Posted by merrittr NO[at]SPAM gmail.com at 4/26/2005 3:42:19 PM
Hi I have a simple problem
hopefully. how would I replace all no numerics using <string name>.regex
if if I have a string like
123456.309.123456
or
123456-307-123456
or
123456 307 123456
all need to be nomalized to
123456307123456
so if
bn="123456-307-123456"
bn=bn.regex([... more >>
FTP file from a remote server
Posted by Lalasa at 4/26/2005 3:38:48 PM
Hi,
I wrote a FTP Client library and this is how I make a socket
connection. But this doesnt work for a remote ftp site. It fails at
Dns.Resolve. How do I make a socket connection for a remote ftp site?
private Socket ConnectSocket(string strRemoteServer, int strRemotePort)
{
Soc... more >>
C#: ComboBox Problem
Posted by tonyblum at 4/26/2005 2:48:02 PM
Hi, I have a comboBox set to also be editable. If I have code that is
something like:
cmbBox.Text = "Hello";
MessageBox.Show(cmbBox.Text);
The MessageBox will display just an empty string. I cannot figure this out.
The text "Hello" will be displayed in the combobox but it doesn't seem to ... more >>
DataAdapter
Posted by JJ at 4/26/2005 1:34:07 PM
Hi,
I created a DataAdapter, connection object and dataset generated from
DataAdapter by dragging DataAdapter compenent to win form. Now in the code
behind I want to use that DataAdapter. I go to use the dataset that was
generated from DataAdapter and I get an Object ref error. So do I hav... more >>
C# and Excel Object range
Posted by Maik at 4/26/2005 1:30:05 PM
Hello,
I've got a problem with access to special ranges. I renamed some cells (for
example "C4" in "CUSTOM.GENERAL.VPRIM"). This is necessary, because I have to
read out only these cells in active worksheet. The method
get_range("RangeName", Missing.Value) is ok as far as I have an existing... more >>
Can't get ITypedList to work with custom collection when binding
Posted by Joe Jax at 4/26/2005 12:05:13 PM
I'm building my own version of a readonly DataTable, which needs to bind to
various controls. My data table class has two main collections
(CollectionBase instances): one of columns, one of rows, where each row has
a collection of column values. I have implemented the ITypedList interface
on... more >>
debug Console Application
Posted by John Grandy at 4/26/2005 10:41:08 AM
When debugging a Console Application in Visual Studio 2003, how to specify
the command line arguments ?
static void Main(string[] args)
... more >>
Where is Enviroment.SpecialFolders ?????????
Posted by Tim Nelson at 4/26/2005 10:32:23 AM
Trying to get the path to My Documents and I can't seem to find the
Environment.SpecialFolders enumeration. Environment.GetFolderPath is
there ... is there some other assembly/DLL that I must reference?... more >>
Threading for FTP in C#
Posted by asadikhan NO[at]SPAM gmail.com at 4/26/2005 9:58:40 AM
Hi,
I am trying to write some threading code to my application. The reason
I've been tempted to do this is because, I am doing some FTP uploads,
and sometimes during the put method, the application just hangs ("Not
Responding") instead of the regular timeout and return. I am using a
library ... more >>
How to ignore @ escape character (C#)
Posted by newcomer2k NO[at]SPAM yahoo.com at 4/26/2005 9:47:05 AM
Hi,
I added a string property for my winforms control.
This string property can take multiple lines of text by using "\r\n".
For example, "Hello\r\nWorld"
SHOULD prints:
Hello
World
The problem is that c# _always_ treats my string as _path_ (using @-quoted).
It prints:
Hello\r\nWorld
I... more >>
How to start a separate application?
Posted by Jeff Connelly at 4/26/2005 9:40:23 AM
Basically just want to "open" a file the same way Windows would do it if you
double-clicked on it, invoking the correct application depending on the file
extension. How to do that from C# code, assuming you just have the file
location and name?
... more >>
CryptoStream.Read Method error when decrypting
Posted by James at 4/26/2005 9:20:03 AM
Hi,
I am developing a ActiveX Control which will be used in a web page.
The control will encrypt some value then decrypt it when the web page opens
next time.
I tested the control in a windows application and it works fine and no error
jumps.
However, when I tried to use it in a web page, pr... more >>
decimal.Parse and negative numbers:
Posted by probashi at 4/26/2005 9:11:07 AM
Hi,
I am trying to the following:
String s = "( 54.05)";
decimal d = decimal.Parse(s);
when s = "( 54.05)" I what the value -54.05
and s = " 54.05" I what the value 54.05
Any suggestion.
Thanks.
... more >>
Delegates and pointers
Posted by Wayne Weeks at 4/26/2005 9:05:04 AM
I am trying to use delegates for the first time and I am probably missing
something. I have a legacy DLL and I have used DllImport to get to the
functions that it contains...the normal function calls work fine, but I can't
get callbacks to work. The delegate declaration etc is below.
publ... more >>
Socket - send bytes to 255
Posted by Dave at 4/26/2005 8:14:02 AM
I'm using sockets. I need to send bytes without alternation from 0-255. When
I use the standard,
Byte[] bytestuff = System.Text.Encoding.ASCII.GetBytes(stuff.ToCharArray());
tSocket.Send(bytestuff,bytestuff.Length,0);
It encodes most characters to ? past asci 127. I beleive that's because ... more >>
Hi all
Posted by Jennifer-Ashley at 4/26/2005 7:57:02 AM
Hi guys,
Just meant to say hi. I came here from Borland products which keep showing
disappointing results. I bought VS 2003 and my problems were over. Just
downloaded a bete version of VS 2005. The likes of something I would have
payed big $$$ for within the context of my former Borland lic... more >>
Issues with Memory
Posted by BuddyWork at 4/26/2005 7:49:41 AM
Hello,
Can anyone explain why this could be happening.
I'm running some code that does the same thing over and
over again. For example query the Sql database for
employees where the name begins with say 'A'. I run this
same query syncrously about 2500 times. Each time I look
at the overa... more >>
Code for finding manufacturer serial number for hard drive in C#
Posted by tayyab.ali NO[at]SPAM gmail.com at 4/26/2005 6:51:11 AM
Hi, If you understand the subject of my post that means you would know
why i want this. Please dont give me the code for Volume number as i
am talking about manufacturer serial number. I am working on C# and I
know about win32_PhysicalMedia to retrieve the manufacturer serial
number but that doe... more >>
Two questions about C# and Sql Server
Posted by eye5600 at 4/26/2005 6:16:02 AM
1) Is there a discussion of somewhere of exactly which versions of Sql
Server will work with visual Studio and C#?
2) Is it possible to use the SQL Server 2000 Desktop Engine from a different
PC over a network by sharing the folder or drive?
... more >>
supported cultures for one application
Posted by znappa at 4/26/2005 5:59:04 AM
Hi.
Is there a way to get a list of supported cultures/languages for my
application.
By calling CultureInfo.GetCultures( CultureTypes.AllCultures )) I get the
whole list of supported cultures en .NET, I would like to get only those that
are supported for my application. ... more >>
Interop: How to hide .NET return type from COM?
Posted by breathwell at 4/26/2005 4:46:51 AM
Consider a C# function that logs an error string and returns a new
Exception object:
System.Exception LogError(string msg)
{
...
return new Exception(msg);
}
In my program, this method is exposed to both .NET and COM clients.
For C++ COM clie... more >>
somebody can modify it for me ?thanks!
Posted by roopeman at 4/26/2005 3:53:04 AM
i want Console write the EventLog message when the source = "Print", code as
following :
using System;
using System.Data;
using System.Diagnostics;
using System.Text.RegularExpressions;
public class LogTest
{
public static void Main(String[] args)
{
string machine = ".";
s... more >>
DataSet update problem
Posted by alastair_anderson NO[at]SPAM hotmail.com at 4/26/2005 3:21:16 AM
I have created a very simple form with which I would like to update a
single
value in a single row of a database as a proof of concept.
The relevant parts of the form are a DBWebTextBox (which is hooked
into a
column ORGANISATION.SHORT_NAME) and a Button which I am using as a
submit
button.... more >>
Translating VB6 dll call to C# -- Help!!!
Posted by shazrul NO[at]SPAM gmail.com at 4/26/2005 3:08:36 AM
Hi,
This is my first time coding in C#. I am trying to implement a call to
a particular function from a dll I downloaded off the internet.
I have managed to do it fine in VB6. Unfortunately I'm struggling in
C#. I can't make the function work. I've tried so many things, i'm
completely at a... more >>
Time delay without Thread
Posted by anonymous at 4/26/2005 12:17:11 AM
Hi all.
I have been programming a simple console application, and want to delay
several seconds in the application for testing purpose.
I've been searching google and this newsgroup, and I found out I could do so
with Thread.Sleep method.
I would like to, however, avoid creating threads if po... more >>
MultiThreading an ActiveX DLL call...
Posted by Cybertof at 4/26/2005 12:00:00 AM
Hello,
Is there a good way to call a big time-consumming function from an
ActiveX DLL (interoped) through a thread without blocking the main UI ?
Here are the details :
I have a class CInteropCall encapsulating a call to a visual basic
ActiveX DLL function named FillAlloc_ArrayStruct_D... more >>
Transaction IsolationLevel problem
Posted by Hardy Wang at 4/26/2005 12:00:00 AM
Hi all,
I have an application, which requires several SQL activities, so I wrap
them in a transaction:
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
SqlTransaction tran = conn.BeginTransaction(IsolationLevel.ReadUncommitted);
I use MS Application Block for D... more >>
unhide window
Posted by Mészáros_Tamás at 4/26/2005 12:00:00 AM
Hi all,
how can I set an app's main window to visible from an other application?
My problem is, that I know only the handle of the other app's main
process, because the application's main window is set to hidden, so it
doesn't have a mainwindowHandle, so I can't send a message to it.
Any... more >>
commandline problem?
Posted by nick at 4/26/2005 12:00:00 AM
Hi all:
In the winform i want to run commandline with return value(string),
then display this string in winform textbox.
anyone has idea about that?
Thanks
Nick
... more >>
Estimate the Time for SQL query Execution
Posted by Saradhi at 4/26/2005 12:00:00 AM
Is there any way to estimate the time required to execute a T-SQL statement?
I need to set the command time out by calculating the time for T-SQL
statement. Can any one give an example?
... more >>
Can I require a C#2.0Bate2 CD form MS ?(FREE)
Posted by Charles Shao at 4/26/2005 12:00:00 AM
Can I require a C#2.0Bate2 CD form MS ?
It's too large to download it by ADSL in my home:P
... more >>
Problems installing service
Posted by Claire at 4/26/2005 12:00:00 AM
Hi,
I know this isn't strictly C# language related, but my service IS written in
c# and I checked out the list of microsoft newsgroups for win2000 and
couldn't really see one that applies.
I'm trying to test my service on a remote win2000 server machine, accessing
the machine as user "admini... more >>
Button Text Not Changed Problem
Posted by Arif Çimen at 4/26/2005 12:00:00 AM
Hi to everybody,
I have chnged a button text in design mode. But After compiling and
executing the program
the text of the button do not change to new value.
Any Ideas?
Thaks for helps.
Arif Çimen
... more >>
Calling a C# component from Classic ASP
Posted by Ben O via DotNetMonster.com at 4/26/2005 12:00:00 AM
Hi Gang,
I've created a C# .NET component which transforms a .TIF file into a .JPEG
file. I have a classic ASP website in which I wish to call this C#
component from my classic ASP.
Can anyone point me in the right direction as to how this may be done. I'm
hungry for some guidance as I can'... more >>
Method or property?
Posted by Allan Ebdrup at 4/26/2005 12:00:00 AM
I have a dictionary that I would like to load with data and then have as
read only, so I can pass it as a result of a get on a property and not have
the recipient of the dictionary change the data in it (and change the data
for everyone else using the property).
I can see from:
http://msdn.m... more >>
When are MS going to fix their API help?
Posted by Michael C at 4/26/2005 12:00:00 AM
MS API help is still geared towards C programmers only despite that fact
that programmers from other languages have been using them for 10+ years
now. When looking up an API it can be a real pain to find the dll that the
API is in and the value of the constants. With the common API like
Show... more >>
Destructors
Posted by Jimmy at 4/26/2005 12:00:00 AM
Hi
when do you use destructors and what are the advantages /disadvantages?
ch Jim
... more >>
Stream is not a valid resource file.
Posted by Daniel Groh at 4/26/2005 12:00:00 AM
This line:
Line 40: ResourceReader objResReader =3D new =
ResourceReader(Server.MapPath("Resources/resTitles.resx"));
Error: Stream is not a valid resource file.
What could it be ? =3D/
Daniel... more >>
A part of a string.
Posted by Daniel Groh at 4/26/2005 12:00:00 AM
Hi i have the following string:
/BooksOnline/CadUser.aspx
But i need to get just ---> CadUser.aspx
How do i do ?
... more >>
Special Characters in Label.Text
Posted by WAkthar at 4/26/2005 12:00:00 AM
Hi,
I have a string for example str = "abc&de"
When I try to put this string into a label, the & character disappears.
How can I stop this from happening?
What about for other special characters?
Cheers
... more >>
Problems sending emails
Posted by Srinivas at 4/26/2005 12:00:00 AM
Hi,
I am using ASP.NET SmtpMail to send email using the following code
public void SendEmail(string From, string To, string Subject, StringBuilder
Message, string Attachment, string mailFormat)
{
MailMessage mailMessage = new MailMessage ();
mailMessage.From = From;
mailMessag... more >>
Opening a dBasee 5.7 table in C#???
Posted by Darryn at 4/26/2005 12:00:00 AM
Hi
I am in the middle of upgrading an old 16bit app written in dBase 5.7 to C#
and i need to do a data conversion tool but cannot seem to be able to open
the dBase tables *.dbf.
any help would be appreciated.
Darryn
... more >>
Lifetime Remoting Sample Needed
Posted by xenophon at 4/26/2005 12:00:00 AM
Looknig fro any small .cs sample showing how the
System.Runtime.Remoting.Lifetime.LifetimeServices Class should be
used.
Thanks.
... more >>
HResult in c#
Posted by Manoj at 4/26/2005 12:00:00 AM
Hi,
In our application we reference com components written in c++.When errors
occur the messages appear like this
'Exception from HRESULT: 0xC0068002"
is there a way to convert this HResult value string (0xC0068002) and convert
it into an int value
thanks in advance
Manoj Nair
... more >>
editable columns in a datagrid
Posted by mai via DotNetMonster.com at 4/26/2005 12:00:00 AM
hi, i'm sort of a newbie in .net and i'm currently doing my major project.
i would like to know if it is possible to have a datagrid that would not be
having a database as its datasource? and is it possible to have an editable
column in that datagrid wherein it would ask for user input? if so, ca... more >>
Configuration Application Block and private user settings
Posted by Mariusz Wojsyk at 4/26/2005 12:00:00 AM
Greetings.
I use Configuration Application Block of Enterprise Library to store some
user application settings like window size, position, etc..
Is there a way to set the FileName property of default XML File Storage
Provider to use ApplicationData folder of current user? This way each use... more >>
Where to find article about {0:c}
Posted by ad at 4/26/2005 12:00:00 AM
Dear Sir
I know {0:c} is a format string.
Where to find the articles aobut that?
... more >>
Update application?
Posted by perspolis at 4/26/2005 12:00:00 AM
Hi all
how can I update my application from internet??I'm looking for a simple
way..
I approciate you if you can show me a simple code.
thanks in advance
... more >>
delegate and event
Posted by Hai Ly at 4/26/2005 12:00:00 AM
Hi,
I'm learning C#. I'm confusing about event and delegate.
delegate void mydelegate();
event mydelegate d1;
mydelegate d2;
What are the differences between d1 and d2 variable ? Whate are the
differences between event and delegate ?
Thank a lot.
Ly Hoang Hai
... more >>
|