Click here to Skip to main content
15,890,527 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSystem.ArgumentException: Parameter is not valid. Pin
nudma15-Jul-09 18:26
nudma15-Jul-09 18:26 
QuestionGridview checkbox without datafield Pin
dptalt15-Jul-09 7:24
dptalt15-Jul-09 7:24 
AnswerRe: Gridview checkbox without datafield Pin
Not Active15-Jul-09 9:02
mentorNot Active15-Jul-09 9:02 
GeneralRe: Gridview checkbox without datafield [modified] Pin
dptalt15-Jul-09 9:28
dptalt15-Jul-09 9:28 
GeneralRe: Gridview checkbox without datafield Pin
Not Active15-Jul-09 10:04
mentorNot Active15-Jul-09 10:04 
AnswerRe: Gridview checkbox without datafield Pin
Abhishek Sur15-Jul-09 10:49
professionalAbhishek Sur15-Jul-09 10:49 
GeneralRe: Gridview checkbox without datafield Pin
Not Active15-Jul-09 15:36
mentorNot Active15-Jul-09 15:36 
QuestionProblem with reading excel before moving data to sql server Pin
rajg8215-Jul-09 6:59
rajg8215-Jul-09 6:59 
I'm reading excel file data using sql bulk copy and uploading the same inside sql server database:

My current code is:

public bool ImportMethod()
{
string sqlConnectionString = "Data Source=192.1.1.10;Initial Catalog=GePReleaseStatus;user=sa;password=sa;Integrated Security=True";
//Create Connection to Excel WorkBook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
connection.Open();
OleDbCommand command = new OleDbCommand("SELECT SrNo AS SrNo,Module AS vcrModule,DefectNoClientName AS intDefectNo, FeratureID AS intFeratureID,Priority AS vcrPriority,Description AS vcrDescription FROM [eContract_4.0.13$]", connection);
using (System.Data.Common.DbDataReader dr = command.ExecuteReader())
{
// Bulk Copy to SQL Server
using (System.Data.SqlClient.SqlBulkCopy bulkCopy = new System.Data.SqlClient.SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "ExcelData";
bulkCopy.WriteToServer(dr);
return true;
}
}
connection.Close();
}
}



Now the problem is:-
1) I'm unable to read the excel, as it has formatted cells at top ?
(common error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005).)
2) how to read the excel from any particular row ?
3) Is it possible to read multiple sheets from a single excel file, how ?



Thanks

raj

AnswerRe: Problem with reading excel before moving data to sql server Pin
Abhishek Sur15-Jul-09 9:54
professionalAbhishek Sur15-Jul-09 9:54 
GeneralRe: Problem with reading excel before moving data to sql server Pin
rajg8216-Jul-09 5:05
rajg8216-Jul-09 5:05 
QuestionCommunication between classes Pin
belier115-Jul-09 6:06
belier115-Jul-09 6:06 
AnswerRe: Communication between classes Pin
David Mujica15-Jul-09 7:14
David Mujica15-Jul-09 7:14 
GeneralRe: Communication between classes Pin
belier115-Jul-09 8:09
belier115-Jul-09 8:09 
GeneralRe: Communication between classes Pin
David Mujica15-Jul-09 8:20
David Mujica15-Jul-09 8:20 
GeneralRe: Communication between classes Pin
belier115-Jul-09 8:47
belier115-Jul-09 8:47 
GeneralWeb page update Pin
David Mujica15-Jul-09 9:15
David Mujica15-Jul-09 9:15 
GeneralRe: Communication between classes Pin
Abhishek Sur15-Jul-09 10:56
professionalAbhishek Sur15-Jul-09 10:56 
QuestionGet GridView Row Number and Fire the SelectedIndexChanged Event Pin
PDTUM15-Jul-09 5:27
PDTUM15-Jul-09 5:27 
QuestionProblem in using Response.BinaryWrite and changing controls Pin
mahesvs15-Jul-09 4:45
mahesvs15-Jul-09 4:45 
AnswerRe: Problem in using Response.BinaryWrite and changing controls Pin
DoctorMick15-Jul-09 5:06
DoctorMick15-Jul-09 5:06 
GeneralRe: Problem in using Response.BinaryWrite and changing controls Pin
mahesvs15-Jul-09 5:11
mahesvs15-Jul-09 5:11 
GeneralRe: Problem in using Response.BinaryWrite and changing controls Pin
DoctorMick15-Jul-09 6:23
DoctorMick15-Jul-09 6:23 
Questionhow to open a page in new window Pin
janani1315-Jul-09 4:24
janani1315-Jul-09 4:24 
AnswerRe: how to open a page in new window Pin
Brij15-Jul-09 4:58
mentorBrij15-Jul-09 4:58 
GeneralRe: how to open a page in new window Pin
janani1315-Jul-09 5:10
janani1315-Jul-09 5:10 

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.