TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
raj kadam
NA
92
7.5k
while importing access file it give format except in c#
Apr 4 2015 10:17 AM
i'm importing access (office 2010)file using c# this my code
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\medi.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""";
// string excelConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\medi.xlsx;Extended Properties=Excel 12.0;";
string sqlConnectionString =ConfigurationManager.ConnectionStrings["sqlcon"].ConnectionString;
//Create Connection to Excel work book
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
//Create OleDbCommand to fetch data from Excel
OleDbCommand cmd = new OleDbCommand
("Select * from [medi1$]",excelConnection);
excelConnection.Open();
OleDbDataReader dReader;
dReader = cmd.ExecuteReader();
// Create object for SqlBulkCopy
SqlBulkCopy sqlBulk = new SqlBulkCopy(sqlConnectionString);
sqlBulk.DestinationTableName = "demo";
sqlBulk.WriteToServer(dReader);
Reply
Answers (
0
)
Change database datetime column value in tmrTimer_Tick event
select item second time from combo record not displayin grid