|
How much memory do you have in your PC that you are running this on? If things are slowing down it seems to me that you are running out of memory. It doesn't really make sense you are having problems since you are only taking 13 bytes of memory for each row. So even at 80,000 records that doesn't take up that much memory.
Here is my idea. First you can try adding some code like dTable.AcceptChanges
after the Add rows line.
If that doesn't help you could try a totally different approach. The basic xml of a dataset is:
<newdataset>
<dTable>
<column1>1</column1>
<column2>1234567890</column2>
<column3>1</column3>
</dTable>
<dTable>
<column1>2</column1>
<column2>2345678901</column2>
<column3>2</column3>
</dTable>
<dTable>
<column1>3</column1>
<column2>3456789012</column2>
<column3>3</column3>
</dTable>
</newdataset>
If you wrote out a file and saved it, you could then load a dataset with that data. Of course if you have a memory issue, that is not a long of memory this is going to take more memory then your other solution.
If you saved this file you can load it into a dataset, so the code would be something like:
DataSet ds = new DataSet();
ds.Load(@"file.xml");
Assuming you saved the xml above to file.xml
Anyway, just another idea.
Ben
|
|
|
|
|
Thanks for the idea Ben. I appreciate. Isint there anythign like Bulk Insert of flat files?
|
|
|
|
|
Not that I know of. I think when you are using flat files you are limited with what you can do.
Ben
|
|
|
|
|
I appreciate your replies Ben.
Thanks.
|
|
|
|
|
DO you have indexes on the table in the database? Drop the indexes, do the import, recreate the indexes. Fixed a similar problem I had some time ago.
Regards
Angel
*********************************************
|
|
|
|
|
Thanks for your reply Angel.
No, there are no indexes. This is just a plain flat file. I have no issues with the process that I am following, except for the performance issue.
What would you suggest, if I go with the approach of copying first 10,000 records and emptying the DataSet, then again copy 10,000 records and emptying, so on so forth.
To me, the above doesnt seem to be a good idea. I posted the code over msdn forums, codeguru forums, but no replies yet!
|
|
|
|
|
How can I populate the treeview from the SQL server by using the ID and Parent ID of the node?
-- modified at 4:07 Saturday 23rd June, 2007
Joseph Thachil
+91 9916025724
|
|
|
|
|
I suspect you'd have to iterate over the data, I don't think a tree view is a data bound control. If it doesn't have a data source property, you need to do it 'by hand'.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I can add parent node and child node, but i can't add child of child node.
+91 9916025724
Joseph Thachil
|
|
|
|
|
Its possible to add child of child nodes.
TreeView TreeView1=new TreeView();
foreach (TreeNode tn in TreeView1)
{
TreeNode tn1;
if (TreeView1.Nodes[intTreeCount].Value == treeNodeValue)
{
tn.Nodes.Add(tn1);
}
int childcount=tn1.ChildNodes.Count;
if(childcount>0)
{
tn1.childNodes.Add(tn2);
}
and so on....
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
i have made simple calculator in csharp but unable to make windows calculator.what should i do.please help
thanks in advance
|
|
|
|
|
seeng wrote: what should i do
Buy a book on winforms and work through it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
T9 dictionary is used in mobiles.i want to make this dictionary using c sharp.give me some idea how to start
thanks in advance
|
|
|
|
|
File\New\Project.
What is a T9 dictionary ? If you need to ask how to write a calculator ( as you did above ), odds are you should buy a book and work through it, so you know enough about C# to understand the answers you will get here.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Check this out: http://www.t9.com/[^]. It shows you how a T9 dictionary works on a mobile phone..
|
|
|
|
|
May I ask why? I guess your computer has just like mine a keyboard with a lot of keys so that there is no need for something like T9..? What point am I missing?
However implementing such a dictionary is not difficult. You only need a list with the words that can be completed and then you need to check this list whenever you press a new key, starting from the last space, point, comma...
I know that this answer doesn't tell you a lot but your question also doesn't tell me a lot about the problem
Just start with it and come back if you have any specific problems!
|
|
|
|
|
I have a program which comes with an image library. I just created a dll that has a method, which takes a name and returns an image from the dlls resources. Issue is, the dll gets loaded into memory when the program runs, I just want to pull out images, not have the whole library in memory. What suggestions do you guys have for ways of doing this ? I'd prefer something that scales well, I could end up with a resource file that lives on a DVD and is over a gig, and I still want the images to load quickly.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You could load the dll into another appdomain, extract the image, then unload the appdomain.
only two letters away from being an asset
|
|
|
|
|
Yeah, I was thinking along those lines, but one of my issues is *speed*. I'm starting to think there's no way of doing it fast, if the images live in the one dll.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I've used the technique before and seemed to be fine, no excess speed issues. Though I wasn't loading large images either. The only hang up was marshalling some data across the appdomains.
only two letters away from being an asset
|
|
|
|
|
OK - thanks. I will give that a try.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Do you have the option of using a resource editor to export the images you need to build into another .DLL?
|
|
|
|
|
Right now, the images are in a seperate dll, I can reorganise them however I like. Making the images secure is a concern, however, so I can't just have a folder full of jpgs and load from the HDD.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian,
if you only need a small fraction of the available images at any point in time,
I would avoid putting them all together in one big file (such as a DLL);
I would go for a kind of index file, and a number of smaller files.
if security and performance are a concern, how about putting all (or a number of)
images as separate files into a password protected ZIP file ?
Hope this helps.
|
|
|
|
|
Don't I need a third party library to open a password protected zip ?
Yeah, I am starting to think about having lots of resource files, and zips had crossed my mind, as a possible solution.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|