|
Try to use bigger bufferSize, so that it takes less itration.
or
Try to create a seperate thread to receive the data, Thread are lightweight then process. so it might restrict the cpu usage.
|
|
|
|
|
Hi,
This question is related to the Calenday Dayview control done by Ertan Tike (Calendar DayView Control[^]) My question is how do I modify it that it stores the title, startdate, enddate, colors and so forth in a SQL server DB rather than in the list?
Any help will be much appreciated.
Thanks
|
|
|
|
|
An Enigma wrote: Calenday Dayview control done by Ertan Tik
Let me call out to his desk, and ask him. ERTAN !!!!
Oh, wait. This site is full of articles from people all around the world. The odds that anyone who reads this forum, is him, are low. If you have a question about an article, you need to ask in the forum under that article.
Having said that, it sounds like a straightforward programming task to me, just write some SQL and connect it up.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
My intention wasnt to ask a direct question to Ertan, I referenced his work so that somebody can have a look at his code, since I am very new to C#. I dont know which part of the code to modify since he uses a list to store the info in.
Thanks
|
|
|
|
|
I teach C# at a local college. I'm starting a new C# II semester in 2 weeks and I'm always looking for new
and interesting projects for the students to do.
It's a WinForm class, and should incorporate some simple SQL. The focus of the class is more advanced topics
such as events, threads and the like.
I'm open to suggestions.
Everything makes sense in someone's mind
|
|
|
|
|
Some Microsoft Press books or O'reilly books would be a good start. Checkout Amazon.com
|
|
|
|
|
Chat/messaging program / homework assignment program / test-taking program.
You post messages to the database (could be a homework assignment or a test question) and they need a client program to access it and then they can reply. Their client should poll the database periodically.
However, they probably shouldn't have direct access to the tables.
|
|
|
|
|
Hi guys,
I am in a bit of dilemma and need some help please!!!
Here is my scenario
I have a couple datagridviews which populate data from a dataset
I have cell_click event which is used to move data from one grid to another. If there is no empty cell in my grid2 then I add a column in the cell click event and populate data into the new column cell.
I also have a drag drop event which I use to move data across grid2, after I do the cell click for some reason it doesn't let me do drag drop, it says object reference not set to an instance of an object in the new cell where the data is being dropped. My assumption is that after I add the column, for some reason there is a null reference on all cells except the added data cell. How do I add the column, update the dataset and the datagridview without reloading the data in the grid.
Hope I make sense. Please helppppp
Sameer
|
|
|
|
|
Without seeing the relevant code, and only relevant code please, it is almost impossible to give a sensible answer. Except to say that adding a column to the DataGridView , does NOT add a column to the underlying DataTable /DataSet , which may be where the null reference exception is occurring.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
dear all
when using unsafe code in c#. How these codes are compiled. What i mean
these codes are compiled under clr or not?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
MSIL also contains IL codes for pointer manipulation such as ldloca (load address of local) and stind (store value indirect) ldflda (load address of field)
|
|
|
|
|
|
If Yes, Than why do we need to access pointer.
By Yes it Means these codes should be changed to MSIL and another thing CLR manages the memory for .Net Application. Then How these c++ variables are not managed without using the keyword fixed?
If I am wrong please correct me.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Abdul Rahman Hamidy wrote: these c++ variables
They're not "C++ variables"; they're still C#.
|
|
|
|
|
Well, I really didnt realized the fact.
when using Pointers It means we are accessing the Memory directory without any layer.
when c# statement It means we are not able to directly access the Memory there should a layer to provide access to memory.
when using the application is fast. specially in loops when I checked it.
but If it runs Under CLR then Y its faster than c# as It is managed by CLR.
Please correct me in my points.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
My understanding is...
If it's written in C#/CLR it's managed.
Unsafe doesn't mean unmanaged.
In an unsafe context you can write managed code that can access unmanaged things.
Abdul Rahman Hamidy wrote: when using the application is fast. specially in loops
Yes, I hear that you can use unmanaged code to do that, but I expect it's better to write a DLL in C/C++ and then use an unsafe context to access that DLL.
But I could be wrong.
|
|
|
|
|
Hi There,
I have been running around on the net with regards to this question and i cannot seem to find a straight answer. I have created the following class with a list property which is of type System.Collections.Generic.List named "FFamily", one will note that i have also implemented the destructor to release the said list:
public class Person
{
private string FName;
private int FAge;
private List<person> FFamily;
public string Name
{
get { return FName; }
set { FName = value; }
}
public int Age
{
get { return FAge; }
set { FAge = value; }
}
public List<person> Family
{
get { return FFamily; }
}
public Person()
{
FFamily = new List<person>();
}
~Person()
{
FFamily.Clear();
}
//public static Comparison<person> AgeComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Age.CompareTo(P2.Age);
// };
//public static Comparison<person> NameComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Name.CompareTo(P2.Name);
// };
}
I have the following code on the main form to test the functionality:
Person Pers1 = new Person();
Pers1.Age = 24;
Pers1.Name = "Zemus";
Person Pers2 = new Person();
Pers2.Age = 2;
Pers2.Name = "Adrian";
Pers1.Family.Add(Pers2);
List<person> Lst1 = new List<person>();
Lst1.Add(Pers1);
foreach(Person PersTest in Lst1) {
MessageBox.Show(PersTest.Name);
foreach (Person PerTest2 in PersTest.Family)
{
MessageBox.Show(" - "+PerTest2.Name);
}
}
Lst1.Clear();
Now according to various articles on the internet it is not necessary to release any of the above mentioned lists and / or items be managed by the GC. I tried to see for myself whether this happens or not.
First thing i did was run the application and keep pressing the button to execute the code block over and over and watched the task manager and it kept on going up.
The second thing i did was call GC.Collect() and MessageBox.Show(GC.GetTotalMemory(false).ToString()) and i saw that the system would now and again drop this value (or do a collection I assume). Just before the count went down it would fire the destructor for the Person class and clear the Family list.
Now i want to know, considering the main list i am instantiating and considering that I am creating items with nested lists would the GC clean up the main list and all the "Person" objects with their "Family" lists? Do i not need to concern myself with the collection of these items? List does not need to implement "IDisposable" to be managed by the GC?
You see, i have many years of Delphi behind me where the creation and release of memory with respect to object instantiation was all explicit.
Thanks,
Anton
|
|
|
|
|
|
Firstly,
When posting code use either the <code></code> for inline code, or the <pre></pre> tags for code blocks (like yours).
so
public class Person
{
private List FFamily;
public string Name
{
get { return FName; }
set { FName = value; }
}
public Person()
{
FFamily = new List();
}
//public static Comparison AgeComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Age.CompareTo(P2.Age);
// };
//public static Comparison NameComparison =
// delegate(Person P1, Person P2)
// {
// return P1.Name.CompareTo(P2.Name);
// };
}
becomes
public class Person
{
private List FFamily;
public string Name
{
get { return FName; }
set { FName = value; }
}
public Person()
{
FFamily = new List();
}
}
abosch2000 wrote: Do i not need to concern myself with the collection of these items? List does not need to implement "IDisposable" to be managed by the GC?
For the most part in .NET, you don't need to implement the destructor or IDisposable, unless there are specific reasons for doing this (e.g. a connection of some sort must be closed, or disposal of child objects needs to take place ion a particular order etc).
You also rarely have to worry about garbage collection. Garbage collection is handled by the .NET framework automatically, any objects that are orphaned are disposed for you periodically. The method the framework uses to determine orphaned objects is quite complicated, but basically it boils down to (as I understand it), if an object is inaccessible from the call stack and is not in an object graph that is accessibile from a call stack, then it is considered orphaned. In the case of list items that have been cleared, the items themselves are orphaned as they no longer appear in the list's tree of objects (presuming there are no other references to the cleared items in other objects). This also happens when a class instance goes out of scope and is not referenced elsewhere.
The disadvantage of the .net framework's implicit collection mechanism is that you don't know exactly when it will happen, just that it happens periodically. In scenerios where memory is a a premium (e.g large numbers of, or very large, objects in the object graph) you might want an explicit Garbage Collection, but more often than not the automatic collection is fine.
Hope this helps.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
can anyone help me by providing "COX" algorithm
modified on Friday, September 25, 2009 11:31 AM
|
|
|
|
|
Not like this. Please remove the caps, I may reconsider helping you.
|
|
|
|
|
Ok, this page[^] might be of interest to you
I don't know much more than that page already says though
|
|
|
|
|
That was just silly.
Everything makes sense in someone's mind
|
|
|
|
|
Yea I know
|
|
|
|
|
No worries.
I use a few different forums, and here on CodeProject ppls seems to be more anal about style and format
than other places.
One common response you see here alot is, "Did you Google it???". I'm thinking, either Yes they did Google it
and were led here, or No they didn't and don't wanna spend alot of time search through Google results. This is
an answer forum and when you ask a question you're hoping for a direct answer. Know what I mean?
Everything makes sense in someone's mind
|
|
|
|