Try using SqlBulkCopy - google for that and check out the example here http://www.sqlteam.com/article/use-sqlbulkcopy-to-quickly-load-data-from-your-client-to-sql-server[^]
Paul Voicu
Posts
-
SQL Copy Table in C# -
Best way to debugWhen you use Trace you can have the code running without pressing the OK of the MessageBox and writing down the message on a piece of paper, while all the messages are going to be written in the Output window, so I would say it's more convenient. I hope it helps. Cheers
-
Best way to debugWhy do you say you cannot debug through your code? I think you could use catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message + " " + ex.StackTrace); }
-
Happy Birthday To You, ROMANIA!Same wishes from Toronto, for all Romanians out there!
-
Treeview deselecting nodes?As far as I know, a treeview can only have one selected node, which you can retrieve with the SelectedNode property. Therefore, I'm not sure what are you refering to when you say that you have selected *several* nodes - maybe checked, like if the treeview is set to diplay checkboxes, and you refer to the checked nodes? Anyways, if you want to "deselect" the one and only node that could be selected in a treeview, try setting the SelectedNode property to null. Otherwise, if you want to "uncheck" any checked node, you must navigate the nodes, say recursively, and set the Checked property of each node to false. Assuming you have a treeview named treeView in your form, create a method called setCheck and call it from wherever you want to perform the clearing of checked nodes (or checking them for that matter):
private void setCheck(TreeNode node, bool isChecked) { if(node != null) { node.Checked = isChecked; foreach(TreeNode child in node.Nodes) { setCheck(child, isChecked); } } }
Call this method like this://********************************* bool isChecked = false; //it will clear the check, true will set the check foreach(TreeNode node in treeView.Nodes) { setCheck(node, false); } //**********************************
Hope it helps. -
Application.Run questionWhat else do you want to do other than hiding the (main) form of the application? I assume you want to launch another form for login or splash or something similar. I suggest placing the code that you want to execute while keeping your form hidden in the OnLoad event delegate of that form. At some point, you will return from that code and continue with the execution of the delegate. I guess you could set the Visible property to false within the OnLoad delegate, but then what do you get to do in your application? Maybe I didn't understand your desired behavior, but I suggest using the form's OnLoad delegate, because before that delegate is finished the form is not shown.