Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
import Data from Excel to under The columns of DatagridView.
Zeb Muhammad
Aug 10 2017 4:07 AM
168
Reply
Dear Friends
first I want to say thank you all , You have a stuning Job here.
Secondly,
I Want to Import Data from Excel File to My DataGrideview columns.
I tried but data coms after My added columns.Please, Check my code bellow.
private
void
button8_Click_1(
object
sender, EventArgs e)
{
string
content =
"provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+ strExcelPathName.Text +
"; Extended Properties=\"Excel 8.0;\";"
;
OleDbConnection con =
new
OleDbConnection(content);
OleDbDataAdapter oda =
new
OleDbDataAdapter(
"SELECT * FROM["
+ txtSheet.Text +
"$]"
, con);
DataTable dt =
new
DataTable();
oda.Fill(dt);
dataGridView1.DataSource = dt;
}
please, help me
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
simple crud without db in mvc4
I want 2 convert div tag into link t have 2 try like