|
I just finished an app that converts 'reading' data from remote sensors. So I can help but I need to clear up somethings.
1: Data is kept in 3 files
2: You open and read one line from the first file out of the set '1-6_.txt'
3: You are taking each para ie '1' & writting it to a file only for paras '1'
If these are the steps, this will not be very hard to optimize.
Let me know if I have the right idea.
Jason
Sometimes simply is better than fancy. The developer stated after typing code line 10 billion!!!
|
|
|
|
|
Yes Jason,
I think you get it right these are the steps for the first type of files, and I have to repeat the step 3 (as in your writing) for all the 6 paras
I would like to rewrite the steps which you wrote as the following to clear a bit more what is needed to be optimized:
1: Data is kept in 3 types of files. (I have to deal with 100s of each type in one conversion task. So lots of them should be read and lots of write operations should be performed)
2: I open first file of first type (i.e. 1-6_00000.txt) and read one line from it
3: From the read in step 2 I get 6 para and a common data/time value (which is the same for all paras in one line) and store these values in 6 different files each for one para.
4: Continue to read till end of the open file and repeat step 3 for it.
5: Take the next file of the same type and repeat 2,3 and 4 for it.
6: Repeat step 2,3,4 and 5 for the other two types of files.
Note that for type 2 (i.e. 7-14_.txt) in 3rd step I would get 8 paras and for type 3 (i.e. 15-16_.txt) in 3rd step I would get only 2 paras
So one can open one file from each type at the same time (when its possible using BackgroundWorker but I dont know exactly how? - ) and I mean the write opreations are not dependent.
Thanks
Regards
|
|
|
|
|
Well don't worry I can help, in refernce to the app I have just completed -it works with data readings taken every 15 minutes all year long. So the data files I have been dealing with have close to 100,000 lines of data and each line contains 8 or 16 different set of 15 minute data. I am converting them to database.
So the problem of yours at hand can be solved. Its almost 5pm here so tomorrow I will reply with what I think might be useful for you.
Thanks,
Jason
Sometimes simply is better than fancy. The developer stated after typing code line 10 billion!!!
|
|
|
|
|
I will be waiting till then...
Regards
Mohsen
|
|
|
|
|
Hello Jason,
I wanted to just ask you, when you can give me your suggestion; coz I am waiting for it very much.
Thanks
Mohsen
|
|
|
|
|
A few questions:
Have you developed a multithreaed app before?
Why don't you save the data to a database instead of six different files?
Does this app run only when you start it or do you want it to run quitly in the background waiting for new data files?
Jason
Sometimes simply is better than fancy. The developer stated after typing code line 10 billion!!!
|
|
|
|
|
Answer-1) I am currently doing some multithreading but not so good in it..
Answer-2) Why I am not saving the data to database?? its just the requirement which is set by customer or better to say set by the organization for which I am doing this app. I have also proposed to use a database instead but they want it in this way for now.
Answer-3) No the app will run whenever the user wants to convert banch of files by clicking a button.
Mohsen
|
|
|
|
|
Hello Jason,
Can you please finally give ur sugesstion to me
Mohsen
|
|
|
|
|
I want to capture keyboard entry in a DataGridView like I would do with TextBox.KeyUp, is there a way to do this ? I want to capture each key, not just the changing of value.
|
|
|
|
|
Youw should handle the DataGridView.EdittingControl.KeyUp event in your code.
Regards
|
|
|
|
|
I wanna add rows to a datagrid in the datagrid itself by inserting data in the cells and pressing the tag button.
Do you know what property in the designer should I mess with to enable me to add new row cells at runtime?
thanks
Naji
|
|
|
|
|
Hi:
yourdatagrid[r,c]=youtext
or you can operate the datatable
|
|
|
|
|
datatable would work.
Do you know how to bind an arraylist to a datatable?
thanks
Naji
|
|
|
|
|
Hi All,
I'm having the worst time trying to bind data to a IBindableComponent. I can bind things fine to a Data Grid View using:
IBindableComponent.DataBindings.Add("DataSource", IList, "MyTable")
But when I do the same thing where the IBindableComponent is a ComboBox:
this._bindableControl.DataBindings.Add( "DataSource", _bindingSource, "Value", true );
It adds it to the combo box's data bindings but does not bind it to the "DataSource" property. Very frustrating. I should note that unless I put in the "true" for "Formatting enabled", it throws an exception saying that the data source needs to be of type "IList" or "IListSource", but guess what, it is!
The "_bindingSource" is a class which implements "IListSource" and returns a "BindingList" of "ItemList" objects. The "Value" data member property that I'm supplying is the "Value" property of the "ItemList" object. This seems like the right approach to me, especially considering the end use of this will be for application developers who need to supply special formatting to what needs to be displayed in the combo box. I've tried using a BindingSource, and basically every other combination I can think of. I don't want to have to implement IList either, that would be extremely messy and unnecessary, in my opinion.
I really want to try and use the interface for this and not cast the object to what it really is. When I do that, it does work, but I want to avoid it at all costs.
Thanks in advance for any help anyone is able to provide. I would really appreciate solving this problem.
Eric
|
|
|
|
|
Don't cross post, you already asked this question in the Soapbox
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
I am just learning C# so please be patient.
I am trying to set up a splash screen that will last for a given amount of time and close itself, but I can't seem to find any references to such an operation (or more likely just can't understand what I have found...)
I have the splash screen set up, it closes when clicked. I just need something that will close the form after X number of seconds.
Thanks in advance!
David Wilkes
|
|
|
|
|
i just get this problem i instead of going it traditionally i tried this (you can say it hack)
in main thread i run a form build for this purpose named frmWelcome
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Screens.frmWelcome());
Application.Run(new Screens.frmMain());
}
then i set a timer in frmWelcome set its time interval equal to the time i want to show it and on its tick event i just write
this.Close();
it is good to be important but it is more important to be good
|
|
|
|
|
amatbrewer wrote: I just need something that will close the form after X number of seconds.
1- Go to the designer mode.
2- In your toolbox, drag a Timer control and drop it in your form -looks like a small clock-.
3- Single click on the Timer control in the panel below your form.
4- In the PropertyGrid set the Interval property to the number of milliseconds you wish -ie. X * 1000-.
5- Double click on the Timer control in the panel below your form.
6- Write the following code in the event handler:
this.Close();
Regards
|
|
|
|
|
Thank You!
This is exactly what I was looking for.
David Wilkes
|
|
|
|
|
hi
i want to pass some parameters to crystal reports but how to do that ?
i tried to pass parameters to Crystal reports by ParameterFields properties but it's could not pass my value to crystal reports fields.
please give me a tested example for vc# 2005 ..
thanks
|
|
|
|
|
If I have a VS.NET 2005 project, and I set its default namespace to be MyCompany.Library, then add a folder to that project (using VS) called Database, and just for giggles, add a subfolder to that called SQL, THEN add a new class to that folder, instead of getting the namespace MyCompany.Library, I get MyCompany.Library.Database.SQL. Easy enough to fix, until I start adding forms and user controls to a similarly set up Windows Forms project, at which point I have to change the namespace in both the Form.cs file AND the Form.Designer.cs file.
Is there a way to turn off this annoying "feature"? I strolled through the VS properties, but it didn't jump out at me.
Thanks in advance!
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
i like this feature i just create folders according to my needs and VS takes care of namespaces
it is good to be important but it is more important to be good
|
|
|
|
|
Well, to each their own.
In my case, my folder structures tend to mirror what they do (Interface Definitions as a folder name, for example), not the namespace pattern I want to use. Plus, if I'm just seperating out functionality, but want the objects in the same namespace, I should be able to do so without having to edit every class.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
i didn't find any solution for that but i think a work around will help
just create the class /form /whatever in you parent directory (MyCompany\Library)
and then drag it to destination folder (MyCompany\Library\Database\SQL)
you can use it until somebody else comes up with a better solution
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
I can not connect to a database oracle 10g from the .net
I receive this error msg "ORA-12154:TNS could not resolve the connect identifier specified
Dad
|
|
|
|