|
How do you determine if a value of a comboxbox was changed by being clicked on? I have set databinding on the combobox and the values in it change when i scroll a datagrid.
Please help
|
|
|
|
|
I want authentication user to pass LDAP
can some body help me !!!1
thanks
|
|
|
|
|
Please don't cross post.
Please write a descriptive subject.
---
b { font-weight: normal; }
|
|
|
|
|
AnhTin wrote: I want authentication user to pass LDAP
In what scenario?
In what version of the .NET Framework
What type of application?
This might help, but since you don't give enough information it might not help: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT02.asp[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Can anyone tell me how do I count the number of seconds elapsed after a certain piece of C# code is executed?
|
|
|
|
|
I would create something to hold a start time. And then when I need to know the number of elapsed seconds I'd get the current time and calculate the difference.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
What do i need to write to get the start time and stop time?
|
|
|
|
|
what do i need to write to get the start time and stop time?
|
|
|
|
|
DateTime - DateTime = TimeSpan
<br />
DateTime start = DateTime.Now;<br />
DoSomething();<br />
TimeSpan result = DateTime.Now - start;<br />
Console.WriteLine(result.Seconds);<br />
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
You can also use the Timer class. Set it to one second and count the number of times the ElapsedTimeEvent is called. I think however the DateTime methid would be better.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Hi all,
I want to create a video player in C# .net that should play all types of video files(.avi,MPEG).
Please give me some examples or articles on video player.
Thanks in advance
cheers
sangeet
|
|
|
|
|
Actually I was trying to convert the Smack API tool that is written in Java using IKVMC to C#.net dll file. In the process of converting, it produced some errors saying that some of the classes or namespaces are missing. Can anyone provide an exact C# dll for smack API that is used with Jivesoftware for xmpp Instant messaging software.
sur
|
|
|
|
|
Please show your ability!
I'd like to use 5 threads running concurrently. They use the same method AccessData to add 2 random numbers in the ArrayList of 1000 elements.
Is there anything wrong in my coding?
How to update the ArrayList after each thread?
How to terminate if there is only 1 number left in the ArrayList?
Thanks so much
using System;<br />
using System.Collections;<br />
using System.Text;<br />
using System.Threading;<br />
<br />
namespace A1_SS<br />
{<br />
class Program<br />
{<br />
static object lockObject;<br />
static ArrayList space;<br />
<br />
static void Main()<br />
{<br />
<br />
space = new ArrayList();<br />
<br />
for (int i = 1; i <= 1000; i++)<br />
{<br />
space.Add(i);<br />
<br />
}<br />
<br />
lockObject = new object();<br />
<br />
<br />
Thread t1 = new Thread(new ParameterizedThreadStart(Program.AccessData));<br />
t1.Start(space);<br />
<br />
Thread t2 = new Thread(new ParameterizedThreadStart(Program.AccessData));<br />
t2.Start(space);<br />
<br />
Thread t3 = new Thread(new ParameterizedThreadStart(Program.AccessData));<br />
t3.Start(space);<br />
<br />
Thread t4 = new Thread(new ParameterizedThreadStart(Program.AccessData));<br />
t4.Start(space);<br />
<br />
Thread t5 = new Thread(new ParameterizedThreadStart(Program.AccessData));<br />
t5.Start(space);<br />
}<br />
<br />
Thread.Sleep(20 * 1000);<br />
}<br />
<br />
<br />
<br />
public static void AccessData(object param)<br />
{ <br />
<br />
ArrayList list = (ArrayList)param;<br />
<br />
lock (lockObject)<br />
{<br />
<br />
<br />
Random rand = new Random();<br />
<br />
int x = rand.Next(1, list.Count);<br />
list.Remove(x);<br />
Console.WriteLine("x = " + x);<br />
<br />
int y = rand.Next(1, list.Count);<br />
list.Remove(y);<br />
Console.WriteLine("y = " + y);<br />
<br />
int newNumber = x + y;<br />
Console.WriteLine("newNumber = " + newNumber);<br />
<br />
list.Add(newNumber);<br />
<br />
<br />
<br />
foreach (object obj in list)<br />
Console.WriteLine(obj);<br />
<br />
<br />
}<br />
<br />
<br />
<br />
}<br />
}<br />
}<br />
eric
|
|
|
|
|
Lots of problems in here.
1. Why are you using lock(lockObject), when lockObject is not being modified or even used by any thread at all!!! If you want to allow one thread at a time to modify your Array List, you should use lock(list).
2. In the code:
int x = rand.Next(1, list.Count);
list.Remove(x);
You are assuming that x is always present in the list. Whereas it is a possibility that x might have been removed by any other thread. Instead of removing the actual entry, you should use the indexes by using RemoveAt, and the number should not be x, it should be list[x].
3. The code written in the function will only execute five times, once per thread. So the list of 1000 will not get exhausted with this. You should use a loop to iterate through the list.
|
|
|
|
|
Thanks so much
But what I mean for x is that I store a random number in ArrayList to x variable, and take that number out of the ArrayList.
Please help
eric
|
|
|
|
|
Ok
I got it. I try now
Thanks Tehnoon
eric
|
|
|
|
|
Hello there!
I've been strugling to find a way of obtaining the value of the (Name) property as a string at runtime (you know, the "label1" piece of text that you get when droping a label on your form).
I need this to do some custom serialization for a component that doesn't implement any other identification property, and I can't seem to be able to do it.
Before I go and extend the component to provide such a property (thus forcing everyone who uses it to type one in), anybody tried to get the (name) property or knows how to do it?
Thanks in advance,
Calin, Toronto
|
|
|
|
|
If you drag and drop a button with the name button1, you can programmatically access its id or name by using the button1.Name property. It's not that difficult ;P
|
|
|
|
|
Hi, Tahnoon, and thank you for your reply.
As I said in my message, this involves a component (not a control). As we all know, the Name property is a property of the Control class, easily accessible for buttons, labels, etc.
However, when you need to access that Name property on a class that doesn't inherit the Control class, thus does not implement the Name property, what do you do?
Thank you again,
Calin, Toronto
|
|
|
|
|
Anyone plz tel me How to change column width in crystalreport at runtime
|
|
|
|
|
I think it's not possible to set width runtime but for displaying the data we can decrease the font size of that paticular column for data to display, which i am following.
Try Try Try....
|
|
|
|
|
I have made several derived buttons and have a backgroundimage on a customized form. My problem is when i use
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
in constructor and set the Color.Tranparent i get flickering when i moveover, -up and so forth.
I have tried doublebuffering and caching and it doesn't seem to eliminate that annoying flickering.
Can anyone help out ?
|
|
|
|
|
Try to capture space under the button to bitmap, on create, move or resize button events. And then draw this bitmap as button background.
|
|
|
|
|
Hi,
I am designing a page where I have two controls . One is TreeListView and one is listbox.
I like to populate the listview with the data from Database based on treelistview item selected.
I will click/check on one of the checkbox in TreeListView and that is used as input to fetch data from database.
Now my problem is when i click on a checkbox in treelistView the treeLIstViewItem checked property is not set till the TreeLIstView is displayed again. So i can not read the checked item(s) and cannot use it to fetch data from Db for the listbox.
I can see that next time i click on another item in treelistview the perviously selected/ checked
item Property is set but the item i clicked just now i cannot read it.
I have multiple child nodes for each treelistview item.
Is there any way i can read the value of the checked items before teh treelistview is displayed on clicent side.
Please help. I am to complete this task latest by tomorrow.
Any help will be appreciated.
Thanks!
|
|
|
|
|
i have moved the application to another machine, i moved the database successfully but the problem that when i open the report it displays the last query before moving i tried to use
rptcust.SetDatabaseLogon(UserName,PassWord,ServerName,DataBase);
but no changes happened and the new added records does not appear in the report.
|
|
|
|