|
For MySQL to work with C# you will need ODBC.NET.
You will also need MyODBC.
Read the help pages for these and you should be all set.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I have recently begun to use NUnit to test a C# project that I am doing for work. However I have run into a snag. Because most of my code is in the executable and not in a DLL, it is difficult to use NUnit to test it. VS.NET won't let me add a reference to it. I find this a little odd because you can just copy the executable to a DLL and then add a reference. But anyways.
NUnit recommends that you just add all of the test code into your executeable project. I disagree with this heavily as I don't want to be shipping out an executable that consist of about 1/4 test code. So here are the solutions I've come up with.
1) I could just wrap an #if DEBUG around the entire class for all of my test classes and put them in their own namespace. I am against this because I feel it is a nasty solution. To much like a lot of the C code that i have seen.
2) Put all of my project code into a DLL. Then have an executable project consisting of one class that calls the main method of the DLL. Then when I wanted to release I could just change the Release to make it an executable instead of a DLL.
Has anyone else come upon this siutaiton before and found a better solution? If nto which of these do you think is preferable
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Hi All,
Can someone tell me like in our tradional model we have MTS as application server, wht is subsitute of MTS in .net platfrom... where I can deploy my components written in c# and forget abt the resource pooling and memory mgmt.
|
|
|
|
|
This is quite a common point of confusion.
Firstly, COM+ (MTS 2) is still alive and well inside the .NET world.
You can add a .NET assembly into COM+, but you need to be aware that you will also be adding the overhead of COM interop.
Remember that you have a far lesser instantiation overhead in .NET as you had in COM.
Mem. management is handled for you in .NET.
Can you provide some more info on the type of application this is for?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Spotted on GotDotNet.com (somethin i was in fact looking for a few weeks ago):
GotDotNet Workspaces Beta Coming Soon
GotDotNet Workspaces is an online collaborative development environment where .NET developers can create, host and manage projects throughout the project lifecycle. Want more information? Check out the new GotDotNet Workspaces whitepaper and don't forget to sign up to receive e-mail announcements about the GotDotNet Workspaces Beta Program!
I hope being a big supporter of CodeProject that we could see somethin similar soon . I find that at sourceforge and freshmeat, that you dont seem to reach your intended audience. While if it was hosted on a .Net or even better a C# site, you could make source available as well as get others to directly view your source or become part of your development team.
Cheers
READ MSDN
|
|
|
|
|
Hi all,
How would one change certain text's formatting inside a RichTextBox programmatically?
I have gotten quite far with this for the following few exceptions:
- Everything is OK until 2 styles overlap (eg. bold and underline). Thus, I need to tackle every char on its own, but this is a no-no as it is too slow ( in my attempted implementation I had to do a single pass for every style )
- Every other "road" I take seems to run into even more preformance issues even before results can be seen.
From what I can see, you have to ways to do this:
1. Format text on the fly (as it gets appended) char by char.
-or-
2. Append all text, then apply formatting on a char by char basis.
Both of these have preformance issues. Is there a way of delaying the invalidation of a RichTextBox and calling it only once all formatting has been applied? Perhaps someone can help me with this. If you need more info, please ask, I'm not so sure if the question is as clear as it should be.
Thanking all in advance.
Cheers
READ MSDN
|
|
|
|
|
There is a 3rd and quicker way that seems to work better by parsing the string on a char by char basis and "recording" the formatting then apply it in string "chunks" each with it own formatting, but its still very slow on complicated formatting
Preventing the RichTextBox from invalidating could solve this, but I m yet to succeed. Its allmost like i need a RichTextBox backbuffer, to do formatting and then I could paste to visible RichTextBox. Maybe, maybe not
READ MSDN
|
|
|
|
|
What are the differences between...
- string and String?
- casting a value using (string) and using ToString()?
Please help, I'm kinda confused. Thanks.
What? Were you expecting something witty or funny here?
|
|
|
|
|
overbored wrote:
string and String?
nothing Same as int = Int32, short = Int16 , bool = Boolean, etc. MSDN defines them as aliases.
overbored wrote:
casting a value using (string) and using ToString()?
The ToString() method allow programmers to have a friendly text definition of an object. EG font.ToString() will return all the font's parameters, name, etc. Purely informational, where a (string) object wont be allowed unless the object is a string or a string cast has been implemented (not sure on how you would do this).
Hope this helps
READ MSDN
|
|
|
|
|
leppie wrote:
Purely informational, where a (string) object wont be allowed unless the object is a string or a string cast has been implemented (not sure on how you would do this).
You can do this with the implicit and explicit operators. Here is a small bit of code that will allow a class to be implicitly cast to a string.
<br />
public static implicit operator string(MyClass c) {<br />
return c.ToString();<br />
}<br />
This will allow for the implicit conversion of MyClass to a string. If you want to force people to explicitly cast to a String then change the keyword to explicit instead of implicit
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
String mostly used in ASP.NET I think.And convert to string there.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I am making a download class, kinda ambitious, considering I know little, but, at the moment, it supports paused/resume downloads, and saving the state of the downloads, so the program ccan be shut down, and the downloads will carry on when iots started up again. anyway, i am trying to add support for multiple downlioad locations, and i want to be able to generate a checksum, or something, for the remote file, and the local file, so that i can verify if the file was downloaded successfully, but i do not know how, any help, or pointers in the right direction?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
i want to be able to generate a checksum, or something, for the remote file,
Thats not really possible unless you own the internet
I assume you want somethin similar to eDonkey's file hashing to prevent corrupted downloads. Unless you can control the other side, you cant get a checksum.
I also presume you want somethin similar to GetRight's Segmented downloading. Most programs doing this, creates a blank file to the size (from the returned HTTP header) of the downloaded file, then writes to the file byte by byte.
You can easily run a "scan" thru the file to see what is still needed. Also by changing the header sent u can resume most files if the server supports partial content (see below).
Nnamdi Onyeyiri wrote:
i am trying to add support for multiple downlioad locations
In your your Download class change the "URL" property to URL[]. Or if you dont have somethin like that, you might want to create it to keep track of other variables like speed, pingtime and availability. Also note that you will need to make sure each download location has exactly the "same" file by comparing the sizes. Also , you need to make sure that the remote file's date hasnt changed (incase file size is the same) when resuming the download, although some servers might create the file on the fly to prevent leeching
Hope this all helps
Example of header sent for partial content:
!!!! ----Header Sent----
>>>> GET /Downloads/MagicInstall.msi HTTP/1.1
Host: www.dotnetmagic.com
Range: bytes=23232-
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)
Accept: */*
If-Range: Fri, 12 Jul 2002 18:28:00 GMT
Example of header recieved for partial content:
!!!! ----Header Recv----
HTTP/1.1 206 Partial Content
Date: Wed, 17 Jul 2002 08:19:38 GMT
Server: Apache
Last-Modified: Fri, 12 Jul 2002 18:28:00 GMT
ETag: "1441e9-8b600-3d2f1fb0"
Accept-Ranges: bytes
Content-Length: 547648
Content-Range: bytes 23232-570879/570880
Content-Type: text/plain
READ MSDN
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
i was not sure how to get them all to write to the same file at once.
Try referencing them all to the same filestream, you will be writing a byte buffer (say 4kb) at any one time, using a lock to prevent (or rather queue) the other threads from writing to the stream at the same time.
READ MSDN
|
|
|
|
|
|
the byte buffer will be written to the file sequencially , you will just need to keep track of the start offset where it should be written in the file for each thread
READ MSDN
|
|
|
|
|
|
If got problems, send me the source as I just created a need to have a class like that as well
Cheers
Good Luck
READ MSDN
|
|
|
|
|
leppie wrote:
If got problems, send me the source as I just created a need to have a class like that as well
a download class?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Yes , something that I want to integtrate into an IRC client i am writing.
READ MSDN
|
|
|
|
|
im not writing a program per say, more of im just writing misc classes, and putting them into a dll, for use in future projects.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Thats what i meant Then I wont have to write it and I can maybe help you better it if neccesary
I am almost 80% complete with my IRC client and HTTP transfer is one of the funtionalities I would like to implement as a plugin to my client, as well as FTP and some file sharing protocols.
Give me a shout then when done please
Cheers
READ MSDN
|
|
|
|
|
|
All...
I've written a windows service which works properly on my development machine and on a QA machine. When installing it on a production machine,the service tries to start however after waiting about 30 seconds, it stops and SCM gives an error that the service did not respond in a timely fashion.
I've gone back to my code and commented everything except for a static logging method that I'm using for debugging. The entry point code is listed below...when starting the service, it is failing between logging the 2nd /3rd lines. Keep in mind that all code is commented out in the "transportClass" at this point and it is still failing to start the service. Given that it works beautifully on multiple other machines, I think it must
be configuration of some sort -- any thoughts???
/*******************************
static void Main()
{
LogError("Starting Main");
System.ServiceProcess.ServiceBase[] ServicesToRun;
LogError("Second Line");
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new
transportClass() };
LogError("Third Line");
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
LogError("Exiting Main");
}
*******************************/
Thanks,
Jason Mark
jmark@comcenters.com
|
|
|
|