|
Thanks for answering, the way I am trying to implements is also the same way you said. I have a ShapeUserControl that get updated by the dataclass through the delegates. But my problem is how can I update the data class through the ShapeUsercontrol. Can you please show me some demo.
|
|
|
|
|
SharePoint & BizTAlk Server.
Among these two, Which one has better future.
For Employment, which course is better ?
Among these two, which one is easy to learn?
Can any one give your views regarding my question???
G. Satish
|
|
|
|
|
Hi, I have set DataSource for a ComboBox and it works properly but now i want to insert another option ALL, how I could do so? Plz help me out.
|
|
|
|
|
I think there are some properties like Add or Items.Add or Insert in combobox. I think you can use it for adding one more item.
ComboBox.Add("ALL");
|
|
|
|
|
Just use the Add method when you want to insert another item into the combobox.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
after populating your combobox from the database
just use the add method to add another item
|
|
|
|
|
Hello
I am a trainee. In a time column we have intime and outtime. For a particular date their may be more than one swipe but i have to take the first time for that particular day as intime and last swipe as outtime. Could any one help me on this how to proceed.
Ex;
abc 29/12/2007 9.00 (AM)
abc 29/12/2007 9.20
abc 29/12/2007 12.00
abc 29/12/2007 13.00
abc 29/12/2007 14.00
abc 29/12/2007 18.00 (PM)
fd 29/12/2007 18.00 (PM)
fd 29/12/2007 19.20
fd 29/12/2007 21.00
fd 29/12/2007 22.00
fd 29/12/2007 4.00 (AM)
so on..... goes on...
How to take the first time as the intime and the last time as outtime. I want to calculate the total time worked for that particular day by any employee (Card number is also avilable) but NO DATA BASE.
|
|
|
|
|
Where are you storing the data ??? in any flat file ??? or in a xml ???
|
|
|
|
|
Hi Abhijit,
I am storing the data in the datatable and there is no database in my project. All the initial information is extracted from MS-Excel Sheet to datagridview. There upon all the data is stored in datatable and displayed.
In the excel sheet there is one column consisting of In/Out Time and i have to calculate the intime and outtime for each employee for given dates. So how should i do it. We cannot segregate as per the department as any one can come any time and go any time.
Waiting for your reply.Thanks for your help in advance.
|
|
|
|
|
Good luck. If you were using a database, it would be alot easier.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Since you file has blank separated fields, for every single line you can extract such fields in a very simple way using String.Split method.
Alternatively, you can use the very powerful Regex Class
http://msdn2.microsoft.com/en-us/library/system.text.regularexpressions.regex(VS.71).aspx[^]
the effort needed to learn its usage is well worth.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
That's just horrible.
First: My brain gibbers at non-ISO 8601 date and time formats.
Second: As mentioned, the lack of delimiters in the file.
However, I'll suggest the use of a System.Collections.Generic.List<System.DateTime>
for each employee (which can be sorted if need be), then intime will be in the zeroth position and the outtime will be in the nth position.
I would likely also have a System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<System.DateTime>> to contain all the employees' data.
Read the file, parse the data, insert it into the dictionary/list, when done, print it out or whatever. Really quite simple actually.
|
|
|
|
|
My earlier question leads to an intermediate goal of understanding delegates. From my readings, there is an important item left out of all the delegate articles I have been reading. The following is a short list of a few important points that I have garnered. I submit them in the hopes that my opinion will be confirmed or corrected.
1. A delegate is a type safe pointer to a function.
2. I will refer to the “pointed to” function as the target of the delegate.
3. A delegate can be used to call its target from outside the target’s name space. To explain my thoughts:
3a. A mouse click is an event that is within the space of the operating system, but outside the space of a program that I may write
3b. I want my program to be aware of the mouse click
3c. The operating system can use the delegate from outside my program.
3d. The arguments passed to the delegate are transported to within my program via the delegate’s call of the target.
3e. This is why the delegate must be a type safe pointer.
3f. By type safe, I mean that the signature of the delegate and its target must match.
4. There are three difficult parts of delegates:
4a. Understanding their purpose
4b. Understanding their capabilities (not a hard as the other two)
4c. Learning the syntax of preparing them for use.
4d. I will just note those items and defer elaboration for later.
I tired to indent the 3a type items but don't know how to do that.
Am I making any progress?
Thanks for your time
|
|
|
|
|
bkelly13 wrote: A delegate can be used to call its target from outside the target’s name space.
This is not clear. By prefixing namespace name, we can call delegates. Do you mean that ?
bkelly13 wrote: Am I making any progress?
Yes. Delegates are simple and I think you covered almost all.
|
|
|
|
|
This article on delegates, found here: http://www.codeproject.com/KB/cs/cs_delgates.aspx
Presents the following code:
<br />
class Del<br />
{<br />
delegate void dl1();<br />
public void fn1()<br />
{<br />
System.Console.WriteLine("Inside f1");<br />
}<br />
public void fn2()<br />
{<br />
dl1 obj = new dl1(fn1);<br />
} <br />
} <br />
I enter the code into C# Visual Express 2008 and select the help key for the phrase “obj” within the last line of code. The result I get contains this statement: “This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.”
Obviously that is of no help. The book “C# in easy steps” does not contain an explanation. I found a two part article on key words and it did not help.
What does this last line accomplish? What does the key word “obj” do here?
Thanks for your time
|
|
|
|
|
A little bit later in the article the author has the code:
<br />
class Del<br />
{<br />
delegate void dl1();<br />
public void fn1()<br />
{<br />
System.Console.WriteLine("Inside f1");<br />
}<br />
public void fn2()<br />
{<br />
dl1 obj = new dl1(fn1);<br />
obj();<br />
} <br />
}<br />
class Example<br />
{<br />
public static void Main()<br />
{<br />
}<br />
}<br />
Why does he put Main inside a class?
Thanks for your time
|
|
|
|
|
The Main() function is called automatically on program start - create a blank Windows Forms Application and examine the Program.cs file - a Main function is created which runs the rest of the application. The author of the article is creating his own rather than using an auto-generated one.
|
|
|
|
|
A) obj is just a name, he could have chosen X or temp or Zaphod
B) All methods must be in a class. (Unlike C/C++)
|
|
|
|
|
Yeah, I see that now. Thank you for taking the time to reply.
Thanks for your time
|
|
|
|
|
obj in this case is simply the name of a new dl1 object (the delegate) - not a keyword.
|
|
|
|
|
I don't know if I am confused or enlightened. Let me try to explain and tell me if I follow you. Start with the code:
<br />
dl1 obj = new dl1(fn1);<br />
This tells the compiler to (left to right):
1. Create something called dl1.
2. Give this new entity the name obj.
3. Create it via the "new" process.
4. Create it in the likness of class dl1. (which has always seemed redundant because the first phrase of this line of code specified that to begin with)
5. Assign this object the target function fn1.
The way I see (saw) obj used so often, it just really seemed like a keyword. I would really like to see people use more descriptive names for classes, methods, and variables.
Thanks for your time
|
|
|
|
|
can someone help me with a program in C# that draws over a game that uses directx?
i want it to be kind of like fraps displays the framerate on the upper left corner of the game. can someone explain how i would do this in C#?
thanks in advanced
|
|
|
|
|
|
Do you just want to display some text in the top left corner (framerate)?.
The DirectX SDK has a common library included with it (under Samples/C#/Common) which has utilities to easily render text. The file you'll be after is D3DFont.cs. You can render text easily with 3 lines of code using the font class included in this.
If you want to know how to display the framerate take a look in the file D3DApp.cs (under the C# common files again), it has a method starting at line 1148 called "UpdateStats" which does what your looking for (if you can be bothered making sense of it).
Mark.
|
|
|
|
|
Hi
I have a bluetooth searching devices project wrote in C# , while I'm search for devices it`ll found a device, the MAC address of the device appear , how can I appear the name of the device....
|
|
|
|