Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Alex Dunlop2-Jun-21 7:34
Alex Dunlop2-Jun-21 7:34 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Dave Kreskowiak2-Jun-21 7:43
mveDave Kreskowiak2-Jun-21 7:43 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Alex Dunlop2-Jun-21 7:48
Alex Dunlop2-Jun-21 7:48 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Dave Kreskowiak2-Jun-21 7:51
mveDave Kreskowiak2-Jun-21 7:51 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Gerry Schmitz2-Jun-21 8:00
mveGerry Schmitz2-Jun-21 8:00 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Dave Kreskowiak2-Jun-21 8:02
mveDave Kreskowiak2-Jun-21 8:02 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Gerry Schmitz2-Jun-21 8:09
mveGerry Schmitz2-Jun-21 8:09 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Alex Dunlop3-Jun-21 2:06
Alex Dunlop3-Jun-21 2:06 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Alex Dunlop3-Jun-21 2:05
Alex Dunlop3-Jun-21 2:05 
GeneralRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Richard MacCutchan3-Jun-21 3:12
mveRichard MacCutchan3-Jun-21 3:12 
AnswerRe: What is the best way for saving huge amount of data into SQL CE file while keeping data uniqueness? Pin
Richard Deeming2-Jun-21 21:41
mveRichard Deeming2-Jun-21 21:41 
QuestionHow to increase filtering speed in DataGridView? Pin
Alex Dunlop29-May-21 22:37
Alex Dunlop29-May-21 22:37 
SuggestionRe: How to increase filtering speed in DataGridView? Pin
Richard MacCutchan29-May-21 22:45
mveRichard MacCutchan29-May-21 22:45 
AnswerRe: How to increase filtering speed in DataGridView? Pin
OriginalGriff30-May-21 2:07
mveOriginalGriff30-May-21 2:07 
GeneralRe: How to increase filtering speed in DataGridView? Pin
Alex Dunlop31-May-21 0:58
Alex Dunlop31-May-21 0:58 
GeneralRe: How to increase filtering speed in DataGridView? Pin
OriginalGriff31-May-21 2:14
mveOriginalGriff31-May-21 2:14 
GeneralRe: How to increase filtering speed in DataGridView? Pin
Alex Dunlop31-May-21 3:59
Alex Dunlop31-May-21 3:59 
GeneralRe: How to increase filtering speed in DataGridView? Pin
OriginalGriff31-May-21 4:43
mveOriginalGriff31-May-21 4:43 
GeneralRe: How to increase filtering speed in DataGridView? Pin
Gerry Schmitz31-May-21 7:30
mveGerry Schmitz31-May-21 7:30 
QuestionPluginLoader with GtkSharp 3.22.x Pin
Jens Eckervogt 25-May-21 23:22
Jens Eckervogt 25-May-21 23:22 
AnswerRe: PluginLoader with GtkSharp 3.22.x Pin
OriginalGriff25-May-21 23:40
mveOriginalGriff25-May-21 23:40 
QuestionMultidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 7:57
michael nabil21-May-21 7:57 
AnswerRe: Multidimensional Arrays error in fill IList Interface Pin
Dave Kreskowiak21-May-21 8:12
mveDave Kreskowiak21-May-21 8:12 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
michael nabil21-May-21 9:09
michael nabil21-May-21 9:09 
GeneralRe: Multidimensional Arrays error in fill IList Interface Pin
Dave Kreskowiak21-May-21 9:43
mveDave Kreskowiak21-May-21 9:43 
That's a bad way to go. Controls should NEVER be used as your storage for data.

Your CSV should be parsed to a data structure designed to hold that data. Fields can be setup to hold strings, integers, doubles, or whatever you need, and the CSV parser just places the values in the appropriate fields with no conversion. The DGV can then be used to display it if needed.

Using the DGV as your storage makes accessing that data slow because you're now doing a bunch of converting to sting or other types that you wouldn't need to do otherwise.

For example, this is garbage. You're converting a value in the DGV to a string and then parsing that string as an integer. This code will also fail if you've got no value in that cell.
C#
invoiceline.quantity = int.Parse(datavalu[i, 5].ToString());
Putting the data directly into a datastructure designed to hold it from the CSV parser is a much better way to go as you get to validate the data before you use or even display it and handle that occurrence at a more appropriate time, when it's being loaded.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.