all groups > c# > june 2006 > threads for thursday june 8
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
Some decimal math.
Posted by William Stacey [MVP] at 6/8/2006 7:35:46 PM
int sqrft = 1335;
decimal pricePerSqr = 18.33m;
decimal pricePerYear = Math.Round(pricePerSqr * sqrft, 2,
MidpointRounding.AwayFromZero);
decimal pricePerMonth = Math.Round(pricePerYear / 12, 2,
MidpointRounding.AwayFromZero);
Con... more >>
Listbox slows down when adding large number of items
Posted by Paul_Madden via DotNetMonster.com at 6/8/2006 6:58:17 PM
Basically I have a listbox to which I add simple STRING items- I have a
progress bar which I increment whenever I populate another portion of the
complete set of items I wish to add. What I observe is that as more and more
are added, population of the list box takes longer and longer. ie the firs... more >>
Making a Typed DataTable Serializable
Posted by cpnet at 6/8/2006 6:15:29 PM
I have a DataTable defined in a strongly-typed DataSet:
[Serializable()]
public class MyDataSet: DataSet...
{
...
public class MyDataTable: DataTable...
{ ...}
...
}
I have a class that references MyDataTable:
[Serializable()]
public class MyClass
{
private MyDat... more >>
transparency on labels
Posted by Daniel at 6/8/2006 6:11:37 PM
Hi guys
I am making a custom form top border and have done it by making 3 picture
boxes.
One is the top border
Second is acting like a button for closing the window
third is acting like a minimise button.
All is fine until i try and use the label button as my window caption/title.
Whe... more >>
csc and resources
Posted by Michael Moreno at 6/8/2006 5:43:39 PM
Hi there,
I am trying to compile a WinForm project using csc.
The compilation works fine. But when I start the project it crashes.
The problem appears to be linked to resources which were created
because I put some ImageLists onto Forms.
I use the following directives with csc:
/res:"... more >>
Dows .Net support different look and feels?
Posted by Scirious at 6/8/2006 4:59:07 PM
People, does .Net (C#) support plugable look and feels as java does? So I
can easily change the look of my softwares?
TIA,
Scirious.... more >>
Why are binaries so big?
Posted by Scirious at 6/8/2006 4:57:47 PM
People, why are C# generated binaries so much bigger than Java ones?
TIA,
Scirious... more >>
RunWorkerCompletedEventArgs.Cancelled always false, even when I know it caught the cancel request
Posted by Steve at 6/8/2006 4:23:07 PM
After running into a design wall with my traditional thread approach, I
realized that a BackgroundWorker object would fit my needs pretty good.
Never really used them before.
In a nutshell, my problem is cancelling the worker. I've read the MSDN
docs, checked google and haven't found a solut... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
CharacterSet problem
Posted by CreateObject at 6/8/2006 4:19:04 PM
I am a newbie user. I am trying to get source code of a webpage using
WebRequest and WebResponse. I've managed to get source code but this time I
got stuck on character set. I can't display non-English characters like ÞÇÜÝ
and so on.
Here is my code;
WebRequest objReq = HttpWebRequest.Crea... more >>
Requested registry access is not allowed.
Posted by Steve Teeples at 6/8/2006 4:05:01 PM
I have a piece of code (written is Visual Studio 2005) that is only reading
the Security EventLog. On Windows XP Professiona/Home this code works just
fine.
int numberOfEntries = myEventLog.Entries.Count;
if (numberOfEntries > 0) ...
However, when run under Windows Vista I get the error ... more >>
Revert VS 2005 DataSet.GetXML() DateTime Format back to VS 2003 Format?
Posted by samtilden NO[at]SPAM gmail.com at 6/8/2006 3:25:36 PM
We have upgraded our web project to Visual Studio 2005 (from VS 2003)
and are still interfacing with some legacy ASP code that we do not want
to change.
The problem is that the VS 2003 compiler used to serialize a DateTime
as:
2006-06-07T15:00:00.0000000-04:00
Now, VS 2005 compiler is se... more >>
cast as T
Posted by Dan Holmes at 6/8/2006 3:03:38 PM
I need to cast a value at runtime to T from object.
public class GreaterThanFilter<T> where T : IComparable
{
private T _value;
private void SetValue()
{
//DataGrid.GetValue(0, 0) returns object
_value = DataGrid.GetValue(0, 0)
// i have tried
_value = (T)DataGrid.GetValue(0,... more >>
Regular Expression Help
Posted by orianavim NO[at]SPAM gmail.com at 6/8/2006 2:32:08 PM
Hi,
i'm looking to find a way (using RegEx) to take the following text
break it into 3 parts:
<table><tr><td>#Content#</td></tr></table> which will give me an
collection/list with 3 elements:
<table><tr><td>
#Content#
</td></tr></table>
please keep in mind that the html might be dife... more >>
DataSet.Designer.cs Help Please
Posted by pyro9219 NO[at]SPAM gmail.com at 6/8/2006 2:23:23 PM
I'm trying to figure out a way to pass this .cs file a variable from
form so that I can build a custom query block.
Example of what this file contains that I want to modify.
this._commandCollection[0].CommandText =
"SELECT *
FROM *
WHERE *";
this._commandCollection[0].CommandType = System.D... more >>
Documents.Open Doesnt work on server.
Posted by BSGY at 6/8/2006 2:23:05 PM
Hello
app.Documents.Open("TEMPLATE.DOC", False, False, False, "", "", False, "",
"") doesnt work on server.
But it is working in my computer.
What is the problem, what can i do ?
... more >>
Calling WNetAddConnection2 from C#
Posted by Mike D Sutton at 6/8/2006 12:28:39 PM
I'm in the process of porting a bunch of code to C# which for the most part is going well, but just can't seem to get
this one to work properly..
Here's the code I'm currently using:
***
[StructLayout(LayoutKind.Sequential)]
internal struct NETRESOURCE {
public int dwScope;
public ... more >>
Concise XML Serialization
Posted by Dave Booker at 6/8/2006 11:06:02 AM
I am serializing a class to XML using the code below, but the XmlSerializer
opens the object's tag with some very verbose attributes: "<TestClass
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml
ns:xsd="http://www.w3.org/2001/XMLSchema">"
I am serializing thousands of these objects,... more >>
Problem with DataRowCollection.RemoveAt() and OleDbDataAdapter.Upd
Posted by George at 6/8/2006 10:46:02 AM
Hi,
I have encountered the following problem.
Say I have the following,
DataGridView dgv;
DataTable dt;
OleDbDataAdapter oleDb_da; (bound to a OleDb data connection)
dt is the bounded data source of dgv, and I use oleDb_da.Fill(dt) to fill
the data table.
If I execute dt.Rows.Rem... more >>
Unit Test configure file
Posted by fran at 6/8/2006 10:42:02 AM
Hello, In a Unit test with visual studio 2005
I have this code in the test assembly:
1.System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
2.ConnectionStringsSection csSection = config.ConnectionStrings;
3.ConnectionStringSettin... more >>
Learning C#
Posted by SpudFlubber at 6/8/2006 10:40:34 AM
I hope the old saying, "The only dumb question is the one you did not
ask." applies here.
I have been "attempting" to program vb.net for years. Previously and
sometimes even now I use vbscript for random projects, but I cannot say
that I truly know vb.net or even vbscript. I am excelent at cod... more >>
.NET: why?
Posted by Devan at 6/8/2006 10:35:01 AM
Does anyone at Microsoft know the number of classes, namespaces and functions
in .NET? Microsoft must have spent a lot of time in development. Do the same
people know how many employees, departments, and time, it took for them to
get here?
I work for a financial firm that is going to start... more >>
Publishing not including XML, XMS files
Posted by Steve Teeples at 6/8/2006 10:30:02 AM
I have a simple application built with several DLLs that access XML files for
information. My local setup works just fine. As defined in my Install
folder, the files are copied to the "application folder" and the DLLs find
them just fine.
However, when I publish the same application to a ... more >>
memberwiseclone and strings
Posted by Dan Holmes at 6/8/2006 10:21:35 AM
Am I reading the docs right? If i have a class that has a string field
when i call MemberWiseClone() the same field in then new object will
reference the string in the original object? Meaning changing one
changes the other.
dan... more >>
Debugging on a machine one doesn't have access to
Posted by Robert W. at 6/8/2006 10:13:02 AM
I have a prospective client who can't get my WinForms app running on his
machine. I sent him some sample .Net apps and they run fine. The error
coming up is very cryptic and doesn't help me resolve the problem.
My "traditional" way of debugging like this would be to create a special
versi... more >>
Search and replace inside a stream
Posted by .... at 6/8/2006 9:45:07 AM
Hi
I have an existing function which has a stream object (inmsg.BodyPart.Data).
I'm trying to search and replace the stream object in the most efficient way
possible
This is my attempt below, however I'm getting a message on the last line
that I can't convert a memorystream to a stream. A... more >>
Cast form from VB 6 to C# at runtime
Posted by ramhog at 6/8/2006 9:23:25 AM
I have a custom control created in C#. The control is being consumed
in a COM exe written in VB 6. At runtime when a user moves the mouse
over the control I want to get the parent form for the control and use
it as if it were a C# form. Is that possible? If so, how?
Redesigning the consumer ... more >>
Simple enumerated state machine impossible in C#
Posted by Shawnk at 6/8/2006 9:11:02 AM
This post is intended to verify that true value semantics DO NOT EXIST for the
Enum class (relative to boolean operations).
If this is true then (thus and therefore) you can not design state machines in
C# where the machine can use the enumerated 'state' to execute (thus the term
'machine' as ... more >>
Generic constraints
Posted by Brian Richards at 6/8/2006 8:49:41 AM
I'm trying to write a generic function (List<TPanelType>
GetGenericPanels<TPanelType, TObjectType>()) that returns all UserControls
that derive from T and and implement an interface IGenericPropertyPanel<V>
such that U implements or derives from V. The idea being that I can discover
(via reflect... more >>
peachtree with c#???
Posted by C# newbie with big problems at 6/8/2006 8:24:29 AM
I have an application that requires accessing peachtree information. is
there any way to use C# to interact with peachtree??
--Roman
... more >>
How to filter by Month using Dataview.RowFilter
Posted by Dr_Franz at 6/8/2006 8:14:02 AM
Hello,
My Code:
dvM1.RowFilter = "DATEPART(Month, Datum) = " + Monat.Month + " AND
DATEPART(Year, Datum) = " + Monat.Year;
But DATEPART is not a ADO Functions?
Can someone help me?
... more >>
Aspx's Html Injection
Posted by orianavim NO[at]SPAM gmail.com at 6/8/2006 7:57:24 AM
Hi,
I'm try to find an easy efficient way to generate my web pages
dynamically from an xml/text file.
What exactly I want?
I want that whenever a pages is loaded it will go and read an xml/text
file which will include the style of the page (tables,div, web
controls, etc) and will bui... more >>
.NET 1.1 and 2.0
Posted by zolof at 6/8/2006 7:46:02 AM
I have made a DLL using C# and .NET 2.0.
My customers develop an app using C# and .NET 1.1 and wants to use my DLL.
How can we do this ?... more >>
how to throw Ballon Tip in C#
Posted by Avi G at 6/8/2006 7:21:01 AM
Hi,
i use VS 2005 and i've Form that have a NotifyIcon on it, when i minimized
the Form it minimized to the Sys Tray ok, i need that when i minimized the
Form it will throw a Ballon popup from the Sys Tray that will say "i'm here"
: - } how i do it?
Thanks... more >>
How to use operators on object acquired by reflection ?
Posted by Sharon at 6/8/2006 6:24:02 AM
I have two object that has been acquired using reflection as follow:
string str = "123";
object param1 = dataRow["myRow"];
System.Type paramType = param1.GetType();
System.Reflection.MethodInfo Parse = paramType.GetMethod("Parse", new Type[]
{typeof(String)});
object param2 = Parse.Invoke(p... more >>
Connection string stored in registry
Posted by nbs.tag NO[at]SPAM gmail.com at 6/8/2006 6:19:54 AM
hey guys heres my question. I was told by a little birdie that .net 2.0
has the ability to read a connection string directly from a registry
key. so in the registry key a string value of say :
database=northwind;user=username;password=pw; is stored at
software/myApp/connSTR in the registry, i... more >>
capture the subject line from the unread mail
Posted by Kondapanaidu at 6/8/2006 6:04:18 AM
Hi,
I am using C#.NET2.0,
My Outlook Inbox is having some mails.
My system Configured with Outlook,
I need to capture the Unread mail subject line.
How to capture the subject line from the unread mail.
Thank in advance for giving great inputs
Thanks & regards
Kondapanaidu
... more >>
Conditional compilation question
Posted by Dave at 6/8/2006 5:54:25 AM
I'm a C++ programmer of many years, trying to get my feet wet in C#.
I have a question about conditional compilation. In C++, I would
sometimes define a constant in an include file, and then have blocks of
code in different source files that were conditionally compiled based
on that constant.... more >>
c# video stream
Posted by ZaRMaS NO[at]SPAM gmail.com at 6/8/2006 5:40:03 AM
Hi all,
I'm developping a project which you can see a video stream in a panel
(like webcam). I am using DirectShowNet library to see the render, and
it works correctly. But i need to compress the video stream in live
with a codec (codec developped in C). Problem is that i don't know how
to re... more >>
About Windows Services
Posted by Water Cooler v2 at 6/8/2006 4:35:05 AM
I want to run a service at the background but also provide some user
interface for editing some configuration options. In this regard, my
questions are:
1. Can a Windows Service have a UI along with it?
2. Can I associate a NotifyIcon (systray icon) with a Web service?
3. Can a Windows servic... more >>
DataList, DataSet or DataTable rows limit
Posted by Aahz at 6/8/2006 4:01:59 AM
Hello;
I have an XML file with data which I show in DataList sucessfully,
using DataSet
Problem is that XML has about 30 records which is too much I need to
show just first 10 ordered by date (10 newest)
I don't know how to do this.
Any help is highly appreciated
Thanks
... more >>
Custom Validation for dates
Posted by daz_oldham at 6/8/2006 4:01:25 AM
Hi All
I am looking to utilise the validation controls to validate a date of
birth, however, I would like to take it one step further than just
making sure that the user has entered a date.
I have three text boxes for each part of the date (DD, MM, YYYY) and
firstly I would like to make sur... more >>
datagridview column size
Posted by Lars Erik Nes at 6/8/2006 3:43:01 AM
Hi all
I have a datagridview which is bound to a dataset. The datagridview is
filled at run-time.
How can set the column-width for each column.
I have tried :
DataGridViewColumn column = dataGridView1.Columns[0];
column.Width = 60;
This works fine if a create a datagrid and the col... more >>
How to do a mouse click outside a Form?
Posted by Iosy at 6/8/2006 3:29:34 AM
Hi all,
I'm working in a application to work in the PC without using a mouse.
I've been using the "User32.Dll" to set the cursor position but I don't
know how to click or double click in any place on my PC without the
mouse (in a shortcut placed in the desktop for example). Is there any
way t... more >>
Username & domain & group
Posted by Stropher at 6/8/2006 3:23:25 AM
If one clicks useraccount via start/settings/control panel one finds
the (created) users of a given computer under the reiter Username,
their domains under the reiter Domain and their groups under Group.
How can I extract or read out these usernames, their domains and the
groups they belong to... more >>
what is the code for restoring application from sys tray
Posted by Avi G at 6/8/2006 3:18:01 AM
Hi,
i've this code that minimize application to sys tray i managed to hide the
application to the sys tray but i don't know how to bring it up back by
double cliking the sys tray icon
this is the code for the hide
private void SysTrayIcon_MouseDoubleClick(object sender,
MouseE... more >>
Multi-Monitor Application
Posted by vikash NO[at]SPAM nagarro.com at 6/8/2006 2:49:48 AM
Hi All,
I am developing a Window based application using .NET 2.0.
In the application i want to have the support for Multi-monitor mode.
For that, i would like to know if there is any in - build support for
creating such application.
Thanks
Vikash
... more >>
Compiler Error Question
Posted by Eric B at 6/8/2006 1:28:29 AM
I have created an object: A. (a control derived from another control)
Using the designer, I made 'A' a field of another object: B.
I then set the Modifier property of 'A' to "Protected" while designing 'B'.
When I compile the code the following error occurs:
"Inconsistent accessibility: fi... more >>
can't understand how to do this with generics
Posted by Barry Mossman at 6/8/2006 12:00:00 AM
Hi, if I have a generic class such as:
public class MyGroup<T> : Collection<MyChildClass>
and from one of it's methods I want to pass a reference to myself to the
following method in another class:
public void OnValidateChanged(MyGroup<MyChildClass> group)
I am trying:
_myReferenceToT... more >>
SQL/OldDbCommand object and parameters
Posted by Steve Barnett at 6/8/2006 12:00:00 AM
I'm trying to do things properly and use OleDbCommand objects and parameters
to build me SQL queries. In the past, I've always built them as strings...
I'm now stuck. I have an SQL statement of the form:
Select <field names> FROM <table name> WHERE field_1 IN ( values list )
How do I s... more >>
try catch just does not work
Posted by Michael C at 6/8/2006 12:00:00 AM
I'm writing an app on the PDA using C# with .net 1.1. It is all working well
except in some cases a try catch is simply ignored and a totally different
error is returned. I've got code like below to execute a command. I'm
simulating loss of connection by stopping sqlserver during a transaction... more >>
Inherited properties
Posted by Daniel at 6/8/2006 12:00:00 AM
Hi guys
I must be missing something fundamental here in my animation prog.
I have a class called Object Manager and in that it holds a List<> of
SceneObjects, on every frame on my animation i update my GameTime which is a
TimeSpan. So inside the object manager i do:
public void GameTime... more >>
Design Question WRT controlling access to private methods
Posted by John B at 6/8/2006 12:00:00 AM
I have a situation where I need to control the creation of a class.
I need to be able to create it externally but only by classes that I define.
To accomplish this I thought of the following process:
Define a delegate that returns an instance of my class.
Pass this an instance of this delegate... more >>
Compiler erro CS0006 during a dynamic compilation
Posted by Giulio Petrucci at 6/8/2006 12:00:00 AM
Good morning everybody,
I have been dealing with this strange issue for almost two days: I got
stuck and I can't get out of it. I built up for the first time in my life
(I'm quite new in stuff like .NET, C#, Visual Studio, windows programming
and so on...) a Windows Service. Debugging it in... more >>
Shared file only builds once
Posted by Paul Cheetham at 6/8/2006 12:00:00 AM
Hi,
I have a source file which is shared by two projects. It is included in
one project, and linked to from another.
In the source I have #if compiler directives, as I want to exclude parts
from one of the projects.
The problem I have is that the project that is linking to the file
does... more >>
very urgent
Posted by alok sengar at 6/8/2006 12:00:00 AM
hi,
I have already tried this URL's code
"http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm"
but I am getting error when i am creating a UDP type Socket and recieving
packet from this socket.
some time error is---"An existing connection was forcibly closed by the
remote host"
and ... more >>
|