|
dophka wrote:
(something I didn't yet find in the properties)
Don't be a drag-n-drop programmer - read the documentation for the DataGrid You'll find a lot more is possible than what the properties provide (some properties are browsable in the designer, and then there's all the methods that you won't see...)
dophka wrote:
when the grid comes out it has four columns as expected but how do I make them fill all the space horizontally?
This is perhaps the biggest problem with the DataGrid . There's really nothing you can do but resize the column programmatically. I'm sure I've seen a couple articles on this here on the CP site. Just try a search.
dophka wrote:
when the text in a column does not fit the grid window horizontally, is there a way to make it put it into a new line? like excel does it?
First of all, you must understand that Excel is a spreadsheet control - not a grid (just so you don't get any other crazy ieas in your head! )
Second, you can create a custom DataGridColumnStyle class that allows you to edit text in multiple lines, but the display of the values is dependent on the DataGrid . To my knowledge, there is no way to get the text to display in multiple lines when not in edit mode.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
can any body tell me link where can i find objective question related to asp.net and csharp
r00d0034@yahoo.com
|
|
|
|
|
What do you mean? Are you asking where you can ask a question about an object for ASP.NET and C#? You can ask here or in the ASP.NET forum - see the links above.
The word "objective" means that a statement is not biased in any way. For a question, this really doesn't make any sense.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi All,
here is a code snippet from my mail program.
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (myemail);
myemail is an object of MailMessage.
If i run this program for the first time in Visual Studio there is an error saying CDO.Message is not accessible.
When it runs all the mail messages are stored in c:\inetpub\mailroot\queue
they do not reach there destinatin. They all are stored in my computer only.
Please someone tell me how to solve this.
WIll be eagrly waiting for the answer.
|
|
|
|
|
Can you post the details of how you're setting up myemail? Make sure the From property is set. Also, use a try/catch block to capture the exception and look for InnerExceptions. An InnerException may give more details as to the nature of the problem.
|
|
|
|
|
Thanx for replying!
i have used this code ..
private void button1_Click(object sender, System.EventArgs e) {
MailMessage myemail = new MailMessage();
myemail.From ="Tushar";
myemail.To ="a_tushar@hotmail.com";
myemail.Subject ="Test";
myemail.Body ="How are you ";
System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send (myemail);
}
using this all my mails are stored on my computer only they are not being delivered at a_tushar@hotmail.com
|
|
|
|
|
Well, the from should be an e-mail address.
|
|
|
|
|
This isn't his problem. As Mazdak said, we answer his question several days ago. His problem is that he hasn't configured the SMTP Virtual Server in the Internet Information Manager. I gave him pointers how to get started and told him to read the help, but he obviously hasn't.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
We answer you some days before. Look at those links and see how you should send email by C# and stop reposting the same question please.
Mazy
No sig. available now.
|
|
|
|
|
Once again I'll tell you that you're code isn't the problem - the problem is that you have NOT configured the SMTP Virtual Server at all or correctly. Again, go to Internet Information Manager in your Administrative Tools folder in the Control Panel and find the SMTP Virtual Server. You have to configure this to send mail using SMTP. It isn't setup by default but there's very little to do. Just read the help files which should be easy to understand.
Once again - as Mazdak also said - this is not a problem with your code, hence quit posting it in the C# forum. It is a problem with your machine configuration of the SMTP Virtual Server. If you need additional help, go to http://support.microsoft.com[^]. It really isn't hard to configure, though.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello again guys.
I have a new problem.
I made a button, which was had a keypress event and it worked perfectly.
Now I've a panel and it hasn't keypress event among its public stuffz.
How can i add my keypresseventhandler function to this panel?
MS Visual Studio.NET 2003
C#
|
|
|
|
|
I may be wrong about this, but I think you have to add the handler to the Form object that contains the Panel, and test if the Panel has the focus.
|
|
|
|
|
Well, i tried to add the handler to the form object, but I can't.
Here's what i did:
public Form1()
{
...
this.KeyPress += new KeyPressEventHandler(this.keypressed);
...
}
void keypressed(Object o, KeyPressEventArgs e)
{
switch (e.KeyChar)//Here I made a breakpoint, but the debugger doesnt reach this point, when I
//press a button...
{
...
}
}
What's the problem?
MS Visual Studio.NET 2003
C#
|
|
|
|
|
Make sure the Form .KeyPreview property is set to true . There are some other good notes in the sdk documentation for Form .KeyPreview that you might want to check out.
I hope this helps--
--mike
|
|
|
|
|
Yeah, thanks.
That works.
MS Visual Studio.NET 2003
C#
|
|
|
|
|
I've started getting a very strange exception in my program.
An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.
That happens sometimes when a window is created (not a specific window, has happened with messagebox and my own forms).
I am using .Net version 1.1. This is my first app with 1.1, so maybe there was some important detail I missed that has changed from 1.0 to 1.1?
I know threads and UI can cause a mess if done badly, but I am not doing any threading at all.
It seems that before the exception occurs, a new thread with no name is created.
VS cannot tell me anything about the thread: there is no call stack, the stack frame selector is unclickable... nothing.
|
|
|
|
|
Many threads are created that handle various things, like painting a control or for asynchronous operations. You never know.
Make sure you're compiling a debug build. There's other reasons you might not be able to use some of the debugging tools (threads are always funny when it comes to that), but just to eliminate the obvious I mentioned that.
If you think it has something to do with threading, check that your application's Main entry point is attributed with the STAThreadAttribute , which is the main UI thread. Usually, though, you get different errors if your application is started in anything other than an STA.
As far as changes 1.0 to 1.1, there really isn't much besides new methods and a few new classes, and a few methods and properties that are now obsolete - nothing conceptual is mentioned, though.
All I can think is to click on the Debug->Exceptions menu and break on all exceptions. Changes are that you'll end up looking at assembler code, but it should give you some stack frame if the debugging symbols are loaded. If you're not using a checked build of Windows, they are probably stripped. VC++ does install some program database (pdb files), but not for the core libraries. If you dig around though, you should at least be able to determine which library you're in. That could help solve the problem since most libraries are pretty specialized.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
OK, thanks for the help. I'll try and see what happens with all exceptions breaking into the debugger on throw.
|
|
|
|
|
(Not sure if i had to post this here, couldn't find a forums here more fitting, if it's supposed to go elsewhere please remove).
I just finished readying: "Teach yourself C# in 24 Hours, by James Foxall", it really was a nice book, but i feel there are parts it discussed that didn't "fill" my knowledge as much as i'd like. Could someone propose a book, a set of books, or a complete training course that it is best for, learning CSharp, understaning OOP as a concept, and taking you to the next level, an intermediate status to pro (well pro without a proffesional experience).
Thanks in advance
|
|
|
|
|
The next thing is to read all the .NET frameworks docs in MSDN from start to finish. That should keep you busy for a year or 2, but you will be a "pro" To reach the next level, you will have to study the EMCA-334/5 C#/.NET CLR specs to answer all your questions you have left After that stage, you can rename yourself to Heath Stewart or something :p
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Thanks ofr pointing these things out for me, but the problem is, i don't trust myself yet to start searching on my own, performing quantum leaps. Even with having finished that book and all the examples/tests in it, i cannot write a simple program on my own, without having 100 backdraws and stuff. Meaning i cannot make code decisions yet, i just type like a blind and hope that this will work. That's why i asked for a book/s that will help me answer questions ( that maybe now i don't know i have, but will surely stumble upon later), and will serve as a quide to get me on knowledge-train, then i will surely have to dig on MSDN library (and CSharp Dev center). And i am also lacking OOP knowledge (only thing i know is what i've read in this book) 'cause C# is the first "real" language i started studying, no c++ background etc.
So if there's a book/s that would fit my needs as i mentioned above, please help me make the right choice
p.s. What is ECMA-334/5 C#/.NET CLR (common language runtime)?
|
|
|
|
|
leppie wrote:
After that stage, you can rename yourself to Heath Stewart or something :p
Good call.
- Nick Parker My Blog
|
|
|
|
|
|
Sorry for this question but I'm looking for a quick answer.
How does .NET load assemblies? - or better how does .NET find the assemblies to load?
For example: if I have myexe.exe which uses mydll.dll myseconddll.dll, etc. does the runtime scan the folder containing myexe.exe for all .dlls and loads them? What if I have 1000 .dlls in a single folder? Will the runtime load them all or just will scan them all?
My exact question is: I want to organize my program like that
main.exe
system/system.dll
system/gui.dll
plugins/someplugin.dll
plugins/moreplugins.dll
As you might guess what is in ./system/ will always be available and used by main.exe but what is in ./plugins/ could be different.
What methods do we have available to load .dlls? I'm currently reading Sam Haidar's article on late binding. Are there any other methods?
Could you please point me to information, where I can find an answer about this question.
I hope my question is clear enough.
|
|
|
|
|
.NET will first look if an Assembly with the same version number is in the GAC, then it falls back to the working executable's directory
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|