all groups > c# > november 2006
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
Q: Is there a C# equilent to vbs ComClass?
Posted by Martin Arvidsson at 11/30/2006 10:48:08 PM
Hi!
I have done a couple of ComClasses in vb, and from now on i want to code
ComClasses in C#
is there an equilent of this in c#? If not how to proceed to get the same
functionallity to be able to expose the com class?
Regards
Martin
... more >>
Access to a printDialog from a PrintPreviewDialog
Posted by choupi at 11/30/2006 9:54:11 PM
Hello,
Is there a way to call a printDialog from a printPreviewDialog (from print
icon for example)?
Indeed, the print icon in the printpreviewdialog prints directly the
document without lunching the printdialog (i.e. the user can't choose the
print parameters).
Thanks a lot.
... more >>
General Question About DataSet
Posted by shachar at 11/30/2006 9:39:01 PM
hi all.
in my dev team we have an argument about retrieving Records from DB to
DataSet.
the big question is: should i retrieve all the records from my table (max
4000 records) to my DataSet, and then, inside the client i'll filter a
DataView, or should i filter the records in the SqlComand... more >>
Adding images to the database
Posted by Earl at 11/30/2006 7:09:25 PM
Looking for an idea here. I've got a .Net app connecting to SQL2005 where I
allow users to add pictures to the database. But I don't want them adding
gigantic images, so I'm looking for an idea on how to control how big of an
image they might add. I'm not interested in simply saving a pointer ... more >>
WMI in my c# app to get mac & IP address
Posted by Jason at 11/30/2006 5:55:21 PM
Hello
I'm writting a c# app, and I've got a computer that has two built in nic's.
One is a Intel Pro/100 and the other is a Intel Pro/1000.
I want to get the mac and ip address assigned to the Intel Pro 100.
Anyone have idea, examples of how I can get that information to display to a
u... more >>
Transparent ListView
Posted by Aleksey at 11/30/2006 4:36:30 PM
Hi, guys!
How can I make ListView to be transparent?
Transparency in C# seems to be a problematic part at all. It's not truly
transparency I used to in Delphi.
Thanks a lot
... more >>
Opening Large Binary file efficiently
Posted by Gina_Marano at 11/30/2006 3:48:38 PM
Hey all,
I need to validate a large binary file. I just need to read the last
100 or so bytes of the file.
Here is what I am currently doing but it seems slow:
private bool ValidFile(string afilename)
{
byte ch;
bool bGraybar = true;
FileStream fs = null;
BinaryReader reader =... more >>
Valid Characters
Posted by preport at 11/30/2006 3:01:50 PM
I'm trying to ensure that all the characters in my XML document are
characters specified in this document:
http://www.w3.org/TR/2000/REC-xml-20001006#charsets
Would a function like this work:
private static string formatXMLString(string n)
{
if (string.IsNullOrEmpty(n)) return... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Dealing with @ in ReadString
Posted by Laurel at 11/30/2006 2:56:44 PM
I've written a function that might return multiple e-mail addresses. I've
been returning them in an XML string, and parsing it using ReadString, but I
get the error below. (Code for ReadString is also included).
Does anyone have any advice as to the best way to proceed?
1 - See if there's ... more >>
Generics - Interface Syntax question
Posted by Gonza at 11/30/2006 12:24:39 PM
Hi group, i need a bit of help with this:
public abstract class BusinessComponent<TData, TDataMapper>
where TData : BusinessEntity,new()
where TDataMapper : DataMappers.DataMapper<TData>, new()
I want BusinessComponent to implement an interface i created, however i
can't get the syntax righ... more >>
Looking for a dll type solution
Posted by Jason at 11/30/2006 12:03:38 PM
Greetings,
When my data is updated in my sql server database there are a number of jobs
that my current process performs that analyzes the new data. This only
happens once a day very early in the am.
When I want to add a new job I have to add new code to the current process.
You probabl... more >>
Is it possible to intercept an attempt to access of a property before it happens?
Posted by martin at 11/30/2006 11:56:17 AM
just wondering....
Say i have a class with 3 nonstatic properties P1, P2 and P3. Now
somebody creates an instance of my class and calls any of them
(instance1.P2)
Is it possible to execute some other function say (checkIfLoaded)
before the property accessor is executed?
I realize i could do ... more >>
WPF
Posted by Peter Morris [Droopy eyes software] at 11/30/2006 11:40:57 AM
Can anyone tell me which group to use to discuss WPF?
Thanks
Pete
... more >>
I've got the timer blues
Posted by Adam Benson at 11/30/2006 11:32:14 AM
Hi,
We have figured out that System.Timers.Timer should be avoided because it
occasionally stops firing.
So, we dutifully began switching over to System.Threading.Timer but somebody
at work now says that System.Threading.Timer can also be unreliable.
Could somebody in the know please te... more >>
bind a dropdwn box to 2 tables - one fills it and the other records it.
Posted by Harry at 11/30/2006 11:29:06 AM
I have two tables in a database. One fills the drop-down and the other
records the selection. Filling the dropdown with another table seems to be
breaking the binding with the table it records to. VS2005 with SQL2005.
I have a lot of these to do, and don't want to hard code each box. I can
dr... more >>
TinyInt or Char(1)?
Posted by Ronald S. Cook at 11/30/2006 10:58:17 AM
In a database table we will have a column "Round" for which round of feeding
the record applies to at a cattle ranch. The value will always be either
1, 2, or 3 since we feed just that many times per day (kind of like
breakfast, lunch, and dinner).
In the table, would you make the column ... more >>
How to find first XML occurrence of <elementName> via SelectSinglenode?
Posted by sherifffruitfly at 11/30/2006 10:33:40 AM
Hi,
Last question (promise). I want to write out a new XML row, tacked onto
the end of everything contained under the first <elementName> section.
I can do the write, I'm just not sure what the xpath is to complete the
following:
XmlElement el = (XmlElement)cdjDoc.SelectNodes(@"first elemen... more >>
Generics and return types
Posted by andyblum NO[at]SPAM gmail.com at 11/30/2006 9:11:15 AM
AM I missing something? How can I create a method that returns a
generic data type without making a formal declaration. For Example:
public List<> getData
{
}
I want my function to be able to return any data type that a caller
wants. I do not care what datatype they invoke with ... more >>
how to use a 2-dimension string array?
Posted by fAnSKyer/C# newbie at 11/30/2006 8:57:04 AM
I know this question is stupid, but I really don't know how to do?
I am trying string[][] s = new string[10][10] and it is wrong?
Can someone give me a help? Or tell me where I can find answer, Thanks
Cheers
FAN
... more >>
Confused on reading attributes of an XML element.
Posted by sherifffruitfly at 11/30/2006 8:53:57 AM
Hi,
I have an xml file with structured like this:
<?xml version="1.0" encoding="UTF-8"?>
<Soldiers>
<Soldier name="Billy Smith" rank="Private" serial="34" />
(a bunch more soldiers)
</Soldiers>
In my program, I have a struct:
public struct soldierStruct
{
public string... more >>
WCF and JMS
Posted by webrod at 11/30/2006 8:27:30 AM
Hi,
I'm a newbie with WCF, I would like to know whether it's possible or
not to send a message to JMS (on a JBOSS Server) with WCF?
Thanks for your help
Rod
... more >>
Creating a Select/Deselect all checkbox in a datagrid
Posted by VBNovice05 at 11/30/2006 8:00:11 AM
I run a search on my database and get items that fit that search in a
datagrid. There are checkboxes already for each item. I need to
create a select/deselect all checkbox at the top of the column and be
able to select.deselect all items that I have found. I am using C#.Net
Thanks in advan... more >>
Regex first match
Posted by Al at 11/30/2006 7:33:57 AM
Hi,
I have the following code :
string sData=@"{\*\bkmkstart adresse1} FORMTEXT }{\rtlch \af0 \ltrch
\f1\fs22\insrsid16733897\charrsid10567516 {\*\datafield
000000000000000008616472657373653100000000000000000000000000}{\*\formfield{\fftype0\fftypetxt0{\*\ffname
adresse1}}}}}{\fldrslt {\rtlc... more >>
Currency class
Posted by Eric at 11/30/2006 7:11:42 AM
Java has this. Anyone know of a .Net equivalent?
Thanks,
Eric
... more >>
Passing object with null member
Posted by news NO[at]SPAM mail.adsl4less.com at 11/30/2006 6:25:21 AM
..Net 2.0
Hi, I'm getting a nullreferenceexception when calling a function from a
worker thread:
private void CallbackProc(string response, Exception ex)
{
if (this.InvokeRequired)
{
this.Invoke(new MyCallback(CallbackProc), new object[] {
response, ex });
}
els... more >>
BenchMarking and Profiling .NET Application Tools
Posted by lava at 11/30/2006 6:07:11 AM
BenchMarking and Profiling .NET Application Tools>>>Which should be
World class providing accurate output. The Tools should Benchmark MY
..NET Remoting Server/Client and SQL Server Database.
... more >>
Simple program not producing output
Posted by garyusenet NO[at]SPAM myway.com at 11/30/2006 3:30:56 AM
Hi.
I am trying to learn about array lists, and found an example on MSDN. I
tried to compile it but it's not producing any output. I can't see why.
Any ideas?
Here is what I did.
1. Started new windows application.
2. Deleted the code files (program.cs, form.cs)
3. Created a new code fi... more >>
flatten multi-dimensional array to on-dimensional array
Posted by per9000 at 11/30/2006 3:13:46 AM
Hi all,
I have a two-dimensional array of data, f.x int's. We can imagine that
the array is "really large". Now I want the data in it and store this
in a one-dimensional array.
The obvious way to do this is a nested for-loop - but we all know
O(n^2) is bad. So I am looking for something lik... more >>
Displaying a Powerpoint presentation on a PC without Microsoft Office installed
Posted by vegvegko NO[at]SPAM gmail.com at 11/30/2006 2:14:38 AM
Hi,
Is there any way to build or distribute a C# application with a
Powerpoint component, so that the application can display Powerpoint
presentations on PCs that do not have Microsoft Office installed?
Thanks for any insight!
Rgds,
Manny
... more >>
using ref keyword performance
Posted by semkaa NO[at]SPAM gmail.com at 11/30/2006 1:50:09 AM
Can you explain why using ref keyword for passing parameters works
slower that passing parameters by values itself.
I wrote 2 examples to test it:
//using ref
static void Main(string[] args)
{
List<TimeSpan> times = new List<TimeSpan>();
DateTime start;
DateTime end;
for (int ... more >>
How do i build my own code 'library' (not .dll!)
Posted by garyusenet NO[at]SPAM myway.com at 11/30/2006 1:18:26 AM
Hi,
As I continue to explore C# , Visual Studio, and Programming in general
I am becoming increasingly hooked. I see myself definately studying and
learning c# with visual studio over the next year or two and am
frequently finding pieces of code i'd like to save for later use.
Is there a be... more >>
strategy pattern instead of switch
Posted by Nick at 11/30/2006 12:51:40 AM
Hi,
I read somewhere recently that the strategy pattern could be used
instead of using switch command on an enum (for example). How would
this work? A small example would be great.
Thanks,
Nick
... more >>
when i use Process.Start() and dos command < or >
Posted by somequestion at 11/30/2006 12:00:00 AM
there are some dos command < or >
it can use like this
if there is a batch file as sample.bat
sample.bat < parameter
sample.bat parameter > result .
i just wanna use this when i use Process.Start() method.
but < is not recongnise a parameter .
how can i do?
... more >>
Designer serialization of non-default values
Posted by Charlie at 11/30/2006 12:00:00 AM
Imagine I subclass Panel into MyPanel and set a few property values to my
own defaults as shown below. Eg. I set BackColor to by LightYellow.
When I add MyPanel to a form, it will write the non-default property values
into the InitializeComponent of the form. So it will explicitily set
myPa... more >>
Newb question: drawing a sprite
Posted by Carl at 11/30/2006 12:00:00 AM
I'm new to C#, and I have only limited programming experience. I've
been doing the video tutorials at MS's website, and they're very
helpful, but I decided to experiment with GDI+ and have gotten stuck.
I'm trying to draw a bitmap on my main form and then to draw a second
bitmap, as if it ... more >>
Problem creating CCW
Posted by Kev at 11/30/2006 12:00:00 AM
Gidday,
I am stuck trying to create a COM Callable Wrapper for the class (shell
only) below.
As you can see I have tried to define my interface and it would be all good
if I wasn't passing my enum into the main functions (which are marked public
static). I am unable to create an interfac... more >>
Append rtf content to a richtextbox
Posted by Fab at 11/30/2006 12:00:00 AM
Hi,
I have a two richtextbox with rtf content.
I just want to add the content of the 2 richtextbox into a third one.
When I use the code below, the richTextBox3 remains empty.
richTextBox3.Rtf += richTextBox1.Rtf;
richTextBox3.Rtf += richTextBox2.Rtf;
And of course i can't use richTextB... more >>
Save Rtf from a RichTextBox into Access
Posted by Fab at 11/29/2006 10:04:58 PM
Hi,
How can I save the text edited in a richTextBox into a field of an Access
table.
I have an error using the following code:
OleDbCommand toto = new OleDbCommand("UPDATE Table1 SET Field1 = '" +
richTextBox1.Rtf.Replace("'","''").Trim() + "' WHERE id = 8"
toto.ExecuteNonQuery.
Field... more >>
Is this the correct way to send a Bitmap over sockets?
Posted by eliss.carmine NO[at]SPAM gmail.com at 11/29/2006 9:50:27 PM
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first
time using C# at all so I don't know if this is the "right" way to do
it. I've already found out several times the way I was doing something
was really inefficient and could reduce 10 lines of code with 2, etc.
For reading... more >>
how to set a shortcut key on a menu item
Posted by Wilfried Mestdagh at 11/29/2006 9:48:36 PM
Hi,
This gives me a runtime error that it is an invalid value. I tryed some
other keys with same result. However I tryed some function keys and they
work (whell I did not test if it work, I did test if there was no
exception). Are there limitations or do I do something wrong here ?
cance... more >>
Maximising a borderless form
Posted by SeanR at 11/29/2006 9:34:20 PM
Hi,
I wasn't happy with the customisability of the standard Windows form,
so I decided to implement my own. Basically what I did was extend a
borderless form and add my own borders and caption bar to it so it
looks and functions like a normal bordered sizable form. However the
only thing I ... more >>
Really simple regex problem
Posted by mikeachamberlain NO[at]SPAM gmail.com at 11/29/2006 9:07:50 PM
Hello there.
This should be very simple for someone to solve.
string s = System.Text.RegularExpressions.Regex.Replace(
"King Henry Viii", "\bViii\b", "VIII");
Console.WriteLine(s);
I think the above code should write out the string "King Henry VIII"
(with capital I's), but instead it w... more >>
Easy question
Posted by Jake Forson at 11/29/2006 9:05:19 PM
Hi there,
Is there a syntactically cleaner way to do this:
if (!(MyObject is Whatever))
{
// ...
}
Thanks.
... more >>
How force VS2005 to use older version of .NET Framework?
Posted by Ronald S. Cook at 11/29/2006 8:37:52 PM
I have been asked to write a ..NET Windows app using the 1.1 framework. I
have both 1.1 and 2.0 on my PC. When I create a new project in Visual
Studio 2005, it shows initial namespaces under references (System,
System.Data) all of which are version 2.0.
How can I tell my project to use on... more >>
MemoryStream instance length is 0 after stream has been written
Posted by Mikus Sleiners at 11/29/2006 8:00:06 PM
I'm trying to write new stream from string and i can't figure out why my
memory stream
instance is null after i have writen to it with stream writer.
Here is an example.
MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter();
writer.Write ("my string");
at... more >>
.NET Grammar modification
Posted by Jon Slaughter at 11/29/2006 7:54:45 PM
I'm curious as to if .NET provides any direct means to modifying its own
grammar? e.g., if say I want to had some "features" to C# which can easily
be reinterpreted back into the original C# but I do not want to have to
write a full blow parser just to change some simple thing.
Lets suppose... more >>
Fastest way to convert an object to a string
Posted by Buddy Home at 11/29/2006 6:47:11 PM
Hello,
I'm trying to speed up a piece of code that is causing performance issues
with our product. The problem is we are using serialization to convert the
object to a string, this is costing us performance degrade. Does anyone know
any better way to archive this which just not degrade perf... more >>
XmlSerializer Hexadecimal question
Posted by INeedADip at 11/29/2006 4:43:23 PM
I have a webservice that returns data from a database.
Our services (the clients) have been blowing up because of illegal
character problems. Is there anything I can do on the server side to
work around this problem. I'm OK with deleting all the "bad"
characters.
I have a couple DTOs that... more >>
c# oledb - multiple inserts to access (mdb) VERY slow - help!
Posted by dan at 11/29/2006 3:55:28 PM
within a loop i am building a sql insert statement to run against my
(programatically created) mdb. it works but it seems unreasonably SLOW!
Sorry, dont have the code here but the jist is very standard (I
think!);
e.g:
# get connection
loop
{
build sql (35 fields to insert)
ca... more >>
System.IO.File.IsBinary() ?
Posted by Ympostor at 11/29/2006 3:13:07 PM
Hello.
Is there a method in the .NET class libraries to know if a given file is
binary or just plain text (ASCII)?
Thanks in advance.
-- ... more >>
|