|
Hi,
I don't know how to solve my problem.
I have datagrid of products, and there is also a column "stock".
If i checked a checkBox i want that datagrid shows only the products which has "stock" 0.
i hope i was understanding
can anyone helps me ?
|
|
|
|
|
BindingSource.Filter might help. Not sure though.
If you are using datagridview, then you have RowFilter property.
|
|
|
|
|
Have a look at the DataView class
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I have a form view control in which i want to add an item in a dropdown list control on its databiund event.. But the code is giving me error .. can any body identify whats is the problem ?
protected void DropDownList1_DataBound(object sender, EventArgs e)
{ ListItem item = new ListItem();
DropDownList dl = new DropDownList();
item.Text= "Please select a driver";
item.Value="0";
dl = Ctype(FormView1.FindControl("DropDownList1"),DropDownList);
dl.Items.Insert(0, item);
}
|
|
|
|
|
You are programming using C#, not C++ or VB.
Use Convert.To...
|
|
|
|
|
CType is a VB command. In C# you just cast the reference:
dl = (DropDownList)FormView1.FindControl("DropDownList1");
When you declare the reference, don't create a new DropDownList object.
DropDownList dl;
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
My application send a email by using SmtpMail but it doesn't work. I have check the smtp on web server, it's functional. Does anybody have any ideas?
Thanks.
<br />
using System;<br />
using System.IO;<br />
using System.Net;<br />
using System.Web.Mail;<br />
<br />
MailMessage msg= new MailMessage();<br />
msg.BodyFormat = MailFormat.Text;<br />
msg.BodyEncoding = System.Text.Encoding.UTF8;<br />
msg.Body = body;<br />
msg.Subject = subject;<br />
msg.To = emailAddress;<br />
msg.From = @"YSCurrencyUpdater"+Dns.GetHostName();<br />
SmtpMail.Send(msg);
|
|
|
|
|
mimilaw wrote: SmtpMail but it doesn't work
Means ? What is the error message ?
|
|
|
|
|
It doesn't get any error message or throws any exceptions.
|
|
|
|
|
mimilaw wrote: My application send a email by using SmtpMail but it doesn't work. I have check the smtp on web server, it's functional. Does anybody have any ideas?
What's the problem if you write the smtp mail address, i.e: without using 'dns.gethostname()'.
I am using the smtp to send emails, and it is working well with no problems, ans the following is my code:
MailMessage message = new MailMessage("FromAddress@yourCompany.com", "ToAddress@yourCompany.com",
"Application Alerts ", "Alert Email from your application System");
SmtpClient smtpClient = new SmtpClient("Your SMTP Name");
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential("The login Name", "Login Password","Your SMTP Name");
Attachment attachment = new Attachment("Attachment Path");
message.Attachments.Add(attachment);
smtpClient.Send(message);
Kind Regards
OBarahmeh
|
|
|
|
|
Hi guys, I am painting each Item for my listbox class and each item has an image with it. The problem is that when I load 20 or 50 plus items in my list the performance issues kicks in and my application takes lot of memory what can i do. Although, I am not dawing something speical in my paint event. Is listview better than listbox. I am happy so far with listbox functionality so far.
Thanks for answering
|
|
|
|
|
Have a look at something called VirtualMode, when this is enabled it will only draw those items which are currently displayed.
|
|
|
|
|
Hi guys.
i want to learn about Anonymous functions in C# 3.
Do you have any helpful links ?
Thank you .
|
|
|
|
|
|
Wow. Thank you very much Vuyiswa .
You're nice.
|
|
|
|
|
amGlad i helped you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi,
i building a application and i use the usercontrol to fill up my form.
My aplication as 3 levels (login usercontrol -> menu usercontrol -> edit usercontrols).
I put the menu usercontrol inside login usercontrol, and other usercontrols inside the menu usercontrol.
I don´t know if this is good pratice, for me work but is messy.
I do this because it´s the only way i know to call the usercontrols since they are inside (and belong) to is parent.(i don´t want to trigger usercontrols from a form).
Other issue is the scrolls (vertical or horizontal), i get some problems since the contents go off limites and the scrolls don´t appear. I set scrolls in the usercontrols.
Code is just works fine,yet , is more a design issue
can anyone help me here???
|
|
|
|
|
Hi All,
How can i upload image to MYSQL USING C#.Plz HELP ME URGENT.Thanks in advance.
SHINOJ K
|
|
|
|
|
Do you know that Song with lyrcs that goes like
"Take time to know her" , i think the singer is Percy Sledge, am sure , but what saying yo you , infact not saying Singing
"Take time to Google,This one is easy"
http://www.google.co.za/search?hl=en&q=Insert+image+to+mysql+using+c%23&btnG=Google+Search&meta=[^]
hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
How can I change the size of icons on the desktop to press a button?. For example, I want to change the size 48x48. I have searched without finding an answer.
Thanks in Advance
really appreciate your help.
|
|
|
|
|
You can get the size using SHGetFileInfo but I don't think it can be set. There's a registry setting that applies to some versions of windows but not all (not vista for example).
Dave
|
|
|
|
|
I am writing a code to test a COM object and one of its functions has an infinite loop.
Basically my code should run this COM object function in a different thread, give it some time to finish but if it doesn't, terminate it.
However, I encountered the following problems:
1) Thread.Abort wouldn't abort the thread because you can't use .NET Thread.Abort to abort unmanaged code.
2) AppDomain.Unload wouldn't do anything because it tries to abort all the threads.
3) I tried using Marashal.ReleaseComObject and it resulted with:
"An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss."
By now the only current options I see is either using somehow the original Windows API to abort the thread or create a process especially to test the function. Both methods seem like a lot of overkill for what I'm trying to do.
Anyone has any ideas?
Vitaly Belman
|
|
|
|
|
One idea: Write an unmanaged wrapper around the COM object that will stop it and return an error code if it times out. So a call to this wrapped object will always return.
Another idea: Get the source to the COM object, fix the infinite loop, and recompile it.
Another idea: Characterize the cases that result in an infinite loop, and avoid calling the function when this would happen. (I like this idea best.)
|
|
|
|
|
Alan is right there, I'm afraid. There's just no way. You simply cannot kill a thread which is stuck in an unmanaged call. We had this problem too with DCOM calls not guaranteed to return, and had to learn that there is no way to get rid of the calling thread but to kill the process. Calling windows api to abort the thread is out of the question when you have a managed thread cause it will pull the api thread right away from under your managed thread's arse and lead to whatever results. So either you set up a complete process for testing, or you handle the testing within COM (but not in VB6, for lack of threading capabilities, but in C++ with ATL and all that void** stuff).
I don't envy you, if that's any consolation. As Alan said, the best bet would be to avoid all situations where the COM call can hang.
|
|
|
|
|
Hi there,
I have a simple user control that I would like to handle mouse events for (such as mouse down etc.). My user control has a couple of Panel objects on it, and these are receiving the mouse events I am interested in. I would like the parent user control to handle the events instead of the panel objects (or anything I insert onto the parent). I understand that I can assign the panel (and any other child object's) mouse event handlers to be the event handler I wrote for the parent, and that works as desired, but I'm wondering if there is a better solution?
So my question is: to have mouse events handled by a parent object, do I need to have each child object's event handler set to be the parent handler code, or is there a property I can set to automatically pass the event to the parent?
Many thanks.
- Dy
|
|
|
|