Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
How to create connection string to excel sheet 2007 by C#
ahmed salah
Feb 28 2017 5:07 AM
318
Reply
I need to know are this connection string to excel is wrong or true
public
static
string
fileName =
string
.Format(
"{0}\\Book502"
, Directory.GetCurrentDirectory());
string
connection =
string
.Format(
"Provider=Microsoft.ACE.OLEDB.12.0;"
+
"Data Source={0};Mode=ReadWrite;Extended Properties='Excel 12.0 Xml;HDR=YES'"
, fileName);
my file book 502
have two sheets
sheet 1
i insert data and update and read data from it
it have following column
ID INTEGER
User Name char(255)
Country char(255)
sheet 2
have following columns
ID INTEGER
Member Name char(255)
meaning all two sheets have text except ID
ALSO file have column in header
processes of two sheets insert update read select
size of transaction i will use 5000 rows
3 USER will use excel sheet
so that what correct format to excel file ?
the format i write working good ?
but really i need what i assign IMEX=0 or 1 or 2
HDR = YES OR NO
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
Why not should we movie common functionality in non abstract
Excel file corrupts while uploading and downloading from FTP