Click here to Skip to main content
15,922,325 members

Comments by EntryLevelGuy! (Top 5 by date)

EntryLevelGuy! 16-Jul-19 21:47pm View    
nvm, i solved it too. haha
EntryLevelGuy! 16-Jul-19 21:32pm View    
Hi, How'd you solved it? Thanks
EntryLevelGuy! 15-Jul-19 4:10am View    
Thank you very much! Gonna try that and i'll comment here after. Hope it works for me :))
EntryLevelGuy! 15-Jul-19 2:49am View    
Yes, i imported the data from excel and display it on datagridview. But for now, i filtered it and select only some of the column that needed to be computed cause there are also id, name etc. column and since its too many.
try {


string constr = "Provider = Microsoft.ACE.OLEDB.12.0;Data Source=" + materialSingleLineTextField1.Text + ";Extended Properties = \"Excel 12.0;HDR =YES;IMEX = 1;\"";
OleDbConnection con = new OleDbConnection(constr);
OleDbDataAdapter sda = new OleDbDataAdapter("Select F12, F13, F102 from [" + comboBox1.SelectedValue + "]", con);
DataTable dt = new DataTable();
sda.Fill(dt);
this.dataGridView1.DataSource = dt.DefaultView;

foreach (DataRow row in dt.Rows)
{
dataGridView1.DataSource = dt;
}

}
catch (Exception)
{
Form3 f3 = new Form3();
f3.Show();
}

this is the code i used. i also used openfiledialog to select xlsx file
EntryLevelGuy! 15-Jul-19 0:01am View    
This is what i've tried, it's in manual way. Though it works, i need to compute a table with 2000+ rows and 100+ columns. This below, only calculate a single row and 8 column. When i use this, the table was filtered and only showed what i write on "Select column1, column2 ... from". This does not work when the whole table was shown.