all groups > c# > april 2008
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
Reading data from a dataset
Posted by sweetiecakes at 4/24/2008 7:10:17 PM
Simple Googling only results filling controls with information -- not
this. The scenario is, that I have a whole table in my dataset. I know
the ID (autoincrementing integer field) of the row to grab data from in
the dataset. How do I get all the data of that row in the dataset?... more >>
hide public property in propertygrid
Posted by J-L at 4/24/2008 6:06:51 PM
Hi,
I have a class with a public property that I don't want to display in
ma propertygrid.
Is is an attribute to hide this property ?
J-L
... more >>
How to write a .NET attribute which does just like ObsoleteAttribute...
Posted by AshokG at 4/24/2008 5:56:46 PM
Hi,
In .NET there is attribute named ObsoleteAttribute which is derived from
System.Attribute Class. This attribute when applied to a target (class or
method etc.) gives a compiler warning/error. I know we can write our own
attributes by inheriting the System.Attribute but I want to make i... more >>
Displaying high-res images in .NET?
Posted by Usenet User at 4/24/2008 5:48:51 PM
..NET 1.1/2.0
I have a need to display high-resolution scrollable images in a .NET
application (Windows Forms). One well known solution is to create a
Panel with AutoScroll set to "true" and then add a PictureBox or
another Panel to it, that is used to display the image.
The above approach ... more >>
Process List / Module List problem..
Posted by dogatemycomputer@gmail.com at 4/24/2008 5:42:15 PM
I'm new to C#.
I am using the following C# method to populate a TreeView control. If
you call this method once during the life of form then it works
perfectly. If you call the method a second time (without closing and
reloading the app) then the process list populates the TreeView
control... more >>
OleDB parameterized query for Access Database
Posted by bob at 4/24/2008 3:55:53 PM
Hi,
Its been a long time since I have had the joy of feeding parameterized
query CommandText strings to an OleDBCommand object.
I have tried all manner of versions of " update foo set bar = @bar
where id = @id"
I have wrapped the fields in square brackets and the parameters in
square bracket... more >>
weird behavior with static int
Posted by parez at 4/24/2008 3:49:35 PM
Hi,
GetNextSequenceNumber2 worked for me in a different class..
but now it does not work.. it does not increment..
will it not get incremented after the return?
private static int GetNextSequenceNumber1()
{
lock (padlock)
{
... more >>
Retrieving text printed in a stored procedure
Posted by Jan_Löhndorf at 4/24/2008 2:11:35 PM
Hi.
Is it possible to retrieve the text I printed in a stored procedure
using PRINT command when using C# SqlDataReader?
Any idea?
Thanks for every hint,
Jan... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
HttpWebRequest - data is truncated?
Posted by Logician at 4/24/2008 1:31:25 PM
I am looking for some help about the method below which partly works.
The problem is that the data returned is truncated in that the
returned data has missing bytes near the beginning of the data. I am
using VS 2005 and C#.
Has anyone got any ideas?
public string getWebPage(string url)
... more >>
Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)
Posted by Martin Racette at 4/24/2008 11:49:19 AM
Hi,
I'm trying to make a programme that will use the above mentioned database,
but I can not find how to create any relation between the tables, all there
is in the database explorer is
DATA CONNECTIONS
DATABASE1.SDF
TABLES
REPLICATION
I can create all the tables, a... more >>
newbie inheritance question
Posted by BillE at 4/24/2008 11:41:26 AM
I have a C# console application.
The class which contains the "static void Main()" method inherits from a
base class.
The base class contains a function GetSomething()
When I try to call this function GetSomething from Main(), I get the error
An object reference is required for the nonst... more >>
Multiple Controls
Posted by Thom Little at 4/24/2008 11:06:33 AM
Using Windows Form C# in .NET 3.5
I have 12 controls on a form. When one of them is clicked I want a common
event handler to do the processing and substitute a single property on the
form. There is a different value for the property in each control.
Is there a standard way to determine wh... more >>
Not getting status event from SmtpClient
Posted by Steve Barnett at 4/24/2008 10:39:40 AM
I'm trying to send emails using the SmtpClient class and, while the messages
get sent, I can't seem to get any status information to that effect. I've
hooked in to the SendCompleted event, but it never fires. Can anyone suggest
why or tell me how to find out whether the email was sent or not?
... more >>
Cannot convert lambda expression of type System.delegate because it is not a delegate type
Posted by Satish at 4/24/2008 10:06:19 AM
When i compile this function I get the error Cannot convert lambda
expression of type System.delegate because it is not a delegate type.
private void SetStatus(string status)
{
if (this.InvokeRequired)
{
this.Invoke( status => SetStatus(status));
}
else
... more >>
how to get memory usage
Posted by auldh at 4/24/2008 10:00:01 AM
i have need to build a program in C# that will collect specific data for a
service on remote machines.
i see how i can use "win32_process" to get threadcount and handlecount of a
service. but i don't see how to get the memory usage as seen in the task
manager.
i have a service that runs ... more >>
Threads debugging
Posted by Lubomir at 4/24/2008 9:59:01 AM
Hi,
I have the folloving code:
Public class MyForm : Form
{
……
void SomeMethod()
{
a = new Obj1(this);
Thread t = new Thread( new ThreadStart( a.CallMethod ) );
t.Start();
}
}
Class Obj1
{
Public Obj1(Form myForm)
{
parent = myForm;
}
Public void Cal... more >>
Adding a reference from the GAC.
Posted by Frank Rizzo at 4/24/2008 9:54:47 AM
Hello, an assembly I want to reference is installed in the GAC and
doesn't have a local copy (e.g. somewhere that is not
c:\windows\assembly...). How do I reference it from VS2005?... more >>
Determine if assembly is installed in the GAC
Posted by Cramer at 4/24/2008 9:32:55 AM
I'm wondering if there is an easy way to programmatically determine if an
assembly is installed in the GAC.
This would be similar to our ability to easily determine if a file exists
(File.Exists(path)) - but for an assembly, of a particular version, etc in
the GAC.
I have googled this an... more >>
Determine currently loaded version of System.Xml.dll and Mscorlib.dll ?
Posted by MC at 4/24/2008 9:17:27 AM
Is there an easy way for a .NET application to determine the version of
Mscorlib.dll and System.Xml.dll that is is actually using?
Given that System.Xml.dll has been revised several times (within .NET 2.0),
I'm wanting to find out if my program is running in an up-to-date
environment.
Th... more >>
sql error message retrieval
Posted by rodchar at 4/24/2008 8:36:02 AM
hey all,
is there a way to have my stored procedure generate an error message that i
can catch in csharp?
thanks,
rodchar... more >>
Get the attribute of a class within this class
Posted by Michael at 4/24/2008 8:30:43 AM
Hello all,
using System;
namespace Test
{
[AttributeUsage(AttributeTargets.Class,
AllowMultiple = false)]
public class FactoryAttribute : System.Attribute
{
public string Identifier { get { return id_; } }
private string id_;
pu... more >>
Studio crashing when I try to select a data source
Posted by Coderer at 4/24/2008 8:17:24 AM
I have a project that I've been working on for a while, where several
forms use DataGridViews to represent database information. The forms
are .NET 2.0, in Studio 2005. For the past couple of days, whenever I
click the little arrow in the top-right corner to show the
DataGridView Tasks subwind... more >>
2 questions about array lists
Posted by Adam Sandler at 4/24/2008 8:04:04 AM
Hello,
I have 2 questions about using array lists.
1. I have a method which returns an arraylist. I'd like to put the
contents of what is returned into another arraylist:
ArrayList al = new ArrayList();
al.AddRange(obj.getArrayList());
The two lines above fail miserably.
2. Can th... more >>
convert double to string
Posted by Denis at 4/24/2008 7:45:34 AM
Hi,
I am trying to convert a double to a string. The problem the value of
the double may vary and I need to always the exact value without the
exponential and without rounding.
Example: double 0.00000000000000000000023 should be string
0.00000000000000000000023 and not 0.00 or 2.3-E24
I t... more >>
inherited forms
Posted by parez at 4/24/2008 7:21:16 AM
Hi,
I have a weird situation.
I have a base form for all my mdi child forms. I have added new
control to the base form in the recent past.. and they show up in the
new forms that i create. but i just realized that they dont show up in
my old forms, forms which were created before the contro... more >>
creating multiple variables with a loop
Posted by AMP at 4/24/2008 6:09:04 AM
Hello,
I am trying to do the following with a loop because the amount of
channels can change.
uint Chan_1 = 0;
uint Chan_2 = 0;
uint Chan_3 = 0;
uint Chan_4 = 0;
uint Chan_5 = 0;
uint Chan_6 = 0;
uint Chan_7 = 0;
... more >>
Protecting code when distributing demo programs
Posted by _DD at 4/24/2008 5:14:26 AM
Is there any practical way to protect .NET demo programs from being
reverse-engineered? This will be for a one-shot thing, and I'm far
from making any money on this, so I'd prefer an economical solution if
that's available.
I'm thinking a combination of code 'obfuscation' and maybe a timeout,... more >>
LINQ. Is this select possible?
Posted by shapper at 4/24/2008 4:09:49 AM
Hello,
I created an SQL table using the Adjacency Model described here:
http://www.sqllessons.com/categories.html
By using this model I am able to hold many categories and
subcategories in one table.
I then need to create a Site Map using <ul> and <li> HTML tags.
I am trying to solve 2... more >>
WCF, Typed Datasets and DataContracts
Posted by matthew-andrews@ntlworld.com at 4/24/2008 12:04:34 AM
Hi,
I'm new to this WCF world, and have attempted to create a WCF service
which takes a typed dataset as its data contract. I know this isn't
always put forward for interopability, but I'm working in a pure .Net
environment (.Net 3.0) and VS2005.
However, how do I get the client to populate... more >>
how to convert byte[] to object[]
Posted by EF@nospam.nospam at 4/24/2008 12:00:00 AM
Hi,
How do I convert a byte[] to an object[]?
I am trying to use IADs PutEx and the last parameter required a variant
array.
Thanks,
Alex
... more >>
Problems Only When Using Run Without Debugging
Posted by Will at 4/23/2008 10:35:02 PM
Hi Everyone,
I have been having a bizarre problem when I do Run Without Debugging
(I have been doing this do to the intensity of some code which runs
slow when Debugging). When I run without debugging, the application
appears hangs on this code:
private static CCPix ClusterListHas... more >>
SelectionBox + dataset confusion
Posted by sweetiecakes at 4/23/2008 8:24:00 PM
I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?... more >>
DataGridView : How to Transform data between user input and validation ?
Posted by TheSteph at 4/23/2008 8:04:24 PM
Hi !
I have a DataGridView with a Date (DateTime) Column.
When a user edit the cell and change the date I woulk like to allow him to
write "081501" and programmatically transform the entered date to
"2008/15/01"( using a custom method called TransformDate(string ARawDate))
But I can't ... more >>
Class recursion question
Posted by cbmeeks at 4/23/2008 6:38:58 PM
Hello all.
I have a project that I am working on and I need some suggestions.
First, I have a class that contains a value and a reference to a
parent class.
For example:
public class Data
{
public Data ParentClass;
public double Value;
}
....
Data d1 = new Da... more >>
Drag Drop Woes
Posted by bob at 4/23/2008 5:40:10 PM
Hi,
VS2008
Trying to implement a simplified version of Mike Gold's tutorial on
Drag Drop.
My problem is that the dragover event handler never appears to pass
over a node.
I move the 'envelope' all over the tree view but FindTreeNode always
returns null.
The event handler e member appears t... more >>
MVC ViewPage<TViewData> How to Inheriting from a Generic Type?
Posted by DotNetNewbie at 4/23/2008 4:45:01 PM
Hi,
In the source code for System.Web.MVC the generic class is defined as:
public class ViewPage<TViewData> : ViewPage
I want to create my own custom ViewPage class, and inherit from the
generic type.
I tried:
public class MyViewPage : ViewPage<TViewDate>
I get a compile erro... more >>
Bitmap Object Class
Posted by eddyctam at 4/23/2008 4:30:01 PM
When creating a Bitmap object in C# with Bitmap temp = new Bitmap("(filename
here)";
What is put into memory? Is it just the bitmap info header or is the entire
bitmap loaded into memory?
If it is the entire bitmap loaded into memory, how can I access a bitmap
without loading it entirely i... more >>
delegate instance
Posted by colin at 4/23/2008 4:03:29 PM
Hi,
How can I use a delegate that I can set to call a non static function
but of any instance of the class ?
eg
class TypeTeader<T>
{
delegate T readDelegate<T>();
readDelegate<T> ReadFunction;
public TypeTeader(readDelegate d)
{
ReadFunction=d;
}
public void read<T>(Binary... more >>
CS0246 (problem with user-defined namespace), C#.NET 2.0
Posted by Calico Tude at 4/23/2008 2:44:04 PM
I am new to C#, and created a simple Windows application in C#, just
to test the logic needed. This was a simple log-in which contained a single
namespace. Namespace included a class (in its own .cs file) containing
regular expressions to validate the format of the entries (user id an... more >>
invoke methods with params
Posted by codefragment@googlemail.com at 4/23/2008 1:17:49 PM
Hi
I want to use reflection to call a method which accepts "params
string[]" as an argument
I've searched this group and found a better idea than invoke, just
cast to an interface and then call the method
directly, but I would still like to know if this is possible, e.g.
something like the... more >>
Filtering Textbox input
Posted by Johnny_Jörgensen at 4/23/2008 1:03:21 PM
I've got a textbox where I filter the input in the KeyPress event to allow
only certain characters.
However, If the user cuts and pastes a text into the textbox, all text is
entered - not only the characters allowed. That doesn't surprise me, but
what is the best way of avoiding that and st... more >>
Please help understand virtual functions
Posted by cctv.star@gmail.com at 4/23/2008 12:47:07 PM
I have a base class that implements IDisposable.
Then I have a derived class, in which I write the following:
public override void Dispose() {
}
... only to get an error: cannot override inherited member ...Dispose()
because it is not marked virtual, abstract, or override. Why??? How a
f... more >>
Font not printing right on SOME printers
Posted by Al Meadows at 4/23/2008 12:40:14 PM
Have a weird one. The application works fine on some printers, doesn't on
others. The problem is that I have a one page report which uses several
fonts and fonts of varying size. The only one I am having trouble with is
the OCR font (see code below). On some machines, when they print to the... more >>
getting first element from array
Posted by CSharper at 4/23/2008 12:00:53 PM
I am trying to use the following; I have an array with bunch of values
in it. I am trying to find a value that contains part of the string I
am passing
eg
string[] array = {"help","Csharp rocks"}
if (array.Contains<string>("Csharp"))
{
//here I want to get the actual string like "Csharp ... more >>
resize events on windows form
Posted by Tarren at 4/23/2008 10:28:49 AM
Hi:
I am trying to get access to the event after a window has been resized. The
events I have been using SizeChanged and Resize all fire after any pixel
size change.
What I am trying to achieve is after the window has been dragged to a new
size (or maximized/restored) then I redraw the ... more >>
Mapping Network Drive in C#
Posted by greatbarrier86 at 4/23/2008 9:47:03 AM
Sorry about that previous one. I pressed enter too early.
How does one go about mapping a network drive in C#. i know you use
MapNetworkDrive in scripting languages, but i'm not sure how to do it in C#.
It doesnt seem like C$ would use MapNetworkDrive.... more >>
XML deserializer sees zero-length file, "root element is missing"
Posted by MC at 4/23/2008 9:41:52 AM
I have a couple of customers who are using a program that deserializes an
XML file, and on some files, the program fails to see the content of the
file -- treats it as zero length and reports "root element is missing" --
even though in Notepad the file looks normal.
Has anybody ever seen t... more >>
Windows Service & System.Timers.Timer production issue...
Posted by Ollie Riches at 4/23/2008 9:28:00 AM
I'm looking into a production issue related to a windows service and
System.Timers.Timer. The background is the windows service uses a
System.Timers.Timer to periodically poll a directory location on a
network for files and then copies these files to another location (on
the network) AND then up... more >>
Question on UserControl
Posted by Dom at 4/23/2008 9:03:24 AM
I've created a UserControl comprised of two controls, a DataGridView
and a DateTimePicker. I've done this because one of the columns in
the DataGridView will hold a date, and when the user clicks on the
column, the DateTimePicker will appear.
Now for the problem.
I want the main program to... more >>
run winform to console
Posted by CSharper at 4/23/2008 8:22:19 AM
I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....... more >>
|