|
|
1. I want sample code for combo box in Data grid View 2.0.
2. Any one can provide source for master/detail form sample.
|
|
|
|
|
regarding infomation about the label in c# coding
swapna
|
|
|
|
|
tanishka wrote: regarding infomation about the label in c# coding
What do you want to know about the label? Be more specific
Do your best to be the best
|
|
|
|
|
Hi all,
I need to know how to authenticate a user before sending a mail using a
C# application.
The source code i use is this:
private void sendMailButton_Click(object sender, EventArgs e)
{
try
{
MailMessage mailMessage = new
MailMessage(toTextBox.Text, fromTextBox.Text, subjectTextBox.Text,
bodyTextBox.Text);
SmtpClient obj = new SmtpClient(SMTPTextBox.Text);
obj.Send(mailMessage);
MessageBox.Show("Message Sent");
}
catch (Exception ex)
{
MessageBox.Show("message not sent");
}
}
I need to add the authentication part. This is working but with no
authentication for the user or the mail sender address. I am using a
local SMTP server.
Thanks,
Jamil Abou khalil
|
|
|
|
|
|
i am getting problem with label i want to add label with authentication mode example if new user come he want to register new account in registration form last press the key how we write the code for that key pls help me asap
swapna
|
|
|
|
|
Please see the thread linked below for tips writing a question, your subject "hi" is useless and your question is not clear.
|
|
|
|
|
Hi,
Iam new to C# , can any one help me to create property within an property in propertygrid (ie) i should have Expandable symbol for a property that doesnt include category .
Thank you
Regards
Praveen
|
|
|
|
|
Hi Praveen,
In the Microsoft PropertyGrid, you can't create directly a property under another property. You must do it like a Font or a Pen does it. For example, if you have a Font property in your target instance, you will be able to see it in the grid and to expand it to see the published properties underneath. This trick is achieved by the FontConverter class. If you look its source code into Reflector you will see how GetProperties() returns a set of customized properties and how CreateInstance() reacreates a font instance with the values of these properties. Studying these classes can help you a lot understand how the propertygrid works. Hope that helps.
|
|
|
|
|
Hi Dear Respected Programmers
I want, suppress line in crystal report when my running balance becomes with minus.
kindly let me know the method that how may I solve this problem.
thank you in advance
(Riaz)
|
|
|
|
|
I am trying to update a VFP table with C# using code like the following:
OleDbCommand olecmd = new OleDbCommand(strcmd, oleconn);
olecmd.ExecuteNonQuery();
I do get an exception raised with 'Feature not Available' so my question is: is there anyway to update VFP data using C# or any .NET language?
i am using windows XP Pro SP2 with visual studio 2005 and VFP 7.0
Your response is greatly appreciated.
Bob Enein
|
|
|
|
|
HI
I am testing a piece of remoting code, I get the following exception message; “BinaryFormatter Version incompatibility. Expected Version 1.0. Received Version 1950887522.2017816692.”
Is the problem associated with my BinaryFormatter Version?
Please help me i tried everything but i cant figure it out
|
|
|
|
|
Hi,
Can anyone answer this question, Please?
How to minimize & zip the access DataBase file programaticaly using C#?
I mean, The size of Access DB file is growing in size rapidly while the Input data is small
Fahd Abo Aiad
|
|
|
|
|
There are zip classes in .NET 2.0, but is that really what you want ? Or do you want to compact the database ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I need to compact the database...
Fahd Abo Aiad
|
|
|
|
|
Hey all,
I need to describe what I'm doing before I can ask my question, so bear with me.
I have implemented a 'limited-heap' where N columns of my DataRow define unqueness.
And M different columns define the sort order so that I can discard rows beyond arbitary MaxRows.
I have a Dictionary<int64,datarow> (ie: a hash table with order(1) lookup)
and a SortedDictionary<int64,int64> (ie: a balanced tree on the key).
I make an Int64 Key from the N Columns in the row, If it exists in my heap I aggregrate some of the data and increment a counter. If it does Not exist I add it.
All this uses the Dictionary<>
Now the magic bit I need to remove the Least Significant row as defined by the M Columns.
So I need them sorted. So I add it to the SortedDictionary<>.
Then If I have More than MaxRows in there, I lookup the first row in my SortedDictionary and remove it from both. (Note that the Value section of the SortedDictionary is not needed).
Now my Question:
I implemented this twice. In the first one I put the Int64 key value from the Dictionary as my key value in my SortedDictionary, then I supplied a Comparer to lookup the Dictionary for the value to compare.
In the second I put the actual DataRow in the SortedDictionary and made sure the comparer used this instead.
Why would this be slower?
My Inserts and Removes from the SortedDictionary was were I lost performace, but I dont know why.
All I can think of is that the referene to the dataRow is bigger than the Int64 keyvalue. And therefore required more memory (but this is my c++ head thinking here, and I don't know if this applies in c#)
Thoughts anyone?
nb: Sorry to be so long.
|
|
|
|
|
Presumably, you have a huge list if you're using an Int64 ?
My guess would be that an int can be compared to an int, nice and easy. If you have two datarows, you need to look up a value in both before you can do a comparison. Or am I wrong, you're just checking if two datarows are references to the same object ? Either way, you've gone from POD to a complex type being passed around and compared.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
the Int64 is just a key, it does not reflect large amounts of data.
When I'm comparing DataRows I'm checking 3 columns (worst case), and I'm doing this to maintain
a sorted list. This is so I can drop the 'smallest' entry off.
You said that I'm now passing a complex type around - This is a DataRow, therefore its 'reference' is passed around only, surely this can not be much bigger than an Int64.
|
|
|
|
|
That's true, it's the cost of comparison that I was focused on.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am working with the new FlatAppearance class under the
System.Windows.Forms.Button control in 2.0 and am creating a flat button. I
set the button FlatStyle to Flat and the FlatAppearance.BorderSize to 1.
When I run the app the border is exactly 2 pixels and not 1.
Is there anolther property you are suppose to set on the control or is this
simply a bug?
Thanks,
Anton
|
|
|
|
|
Hi,
can anyone offer some pros as to why raise an exception?
Imagine Im developing a function. I can either account for errors by using a try...catch statment, or I can raise an exception.
But Im missing the point of an raising an exception. I can understand why it occurs, but not for reason in the real world.
If I development a function that requires a integer parameter to be less than 10, why would I need to create an exception if its greater? Surely Im going to be aware of that myself? Likewise, I would much rather the application deal with the problem using a try...catch, than throw an exception causing it to creash.
So therefore, raising exceptions is bad?
Can anyone offer any thoughts?
Mark
|
|
|
|
|
One of the best reasons to use exceptions is to make the method that is calling your method aware that something has gone wrong and needs to be dealt with.
Suppose you have written a method that writes a file to disk. Now let's assume that for whatever reason, the file can't be written to disk (disk is full, network error etc.).
Now how should your method handle these errors. You can of course pop up a messagebox explaining to user what has gone wrong, but your calling method will never be aware of the error (unless you return a status code of some kind). You could choose to try to handle the error in the called method, but it is possible that your method can't resolve the error. In that case it is better to make your calling method responsible for handling this.
So the best way to handle these situations is as follows (pseudo code)
try<br />
{<br />
}<br />
catch (ArgumentException e)<br />
{<br />
}<br />
catch (Exception e)<br />
{<br />
throw e;<br />
}
Regards,
Nico
p.s.
Which of the Code Project gurus around here can tell me how to make the tabs in my example code visible. It looks horribly unindented now...
|
|
|
|
|
Nico van der Plas wrote: p.s.
Which of the Code Project gurus around here can tell me how to make the tabs in my example code visible. It looks horribly unindented now...
Use the pre tag.
---
b { font-weight: normal; }
|
|
|
|
|
Mark06 wrote: Imagine Im developing a function. I can either account for errors by using a try...catch statment, or I can raise an exception.
You should only catch exceptions that you know how to handle within the function. A try/catch around all your functions is a bad idea.
Mark06 wrote: If I development a function that requires a integer parameter to be less than 10, why would I need to create an exception if its greater?
So the calling function knows why you couldn't process it's input.
Mark06 wrote: So therefore, raising exceptions is bad?
That depends, would you prefer the program to crash on your machine, or on your users ? When an exception occurs, it indicates that a situation has arisen in your code which you've not properly handled.
FWIW, any windows program I write handles exceptions at the top level and writes them to a log file, exceptions are also exceptionally useful at helping me to work out why code that runs fine here, doesn't always work in the real world. Code that swallowed exceptions would not give me that information, and would make my life a lot more difficult.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|