Hi Friends,
Anyone please help me and tell me how to resolve the issues mentioned below:
I got an Excel sheet. I need to read data from excel sheet. Fields are manufacturer, partnumber, description, and price. I need help to read the data from Excel sheet and store it in a sqlserver database based on the manufacturer and partnumber.
I was trying to implement the logic but when I read the data from excel sheet and assign it into dataset i face issues.
Issue 1:
The row count 2754 is shown, but in my excel sheet only 5 rows are available.
OleDbConnection oledbCon = new OleDbConnection(strCon);
oledbCon.Open();
OleDbCommand oledbCmd = oledbCon.CreateCommand();
oledbCmd.CommandText = "SELECT * FROM [Sheet1$]";
DataSet ds = new DataSet();
OleDbDataAdapter oledbDa = new OleDbDataAdapter(oledbCmd);
oledbDa.Fill(ds, "TempExcel");
ds.Tables[0].Rows.Count
Issue 2:
If price fields in Excel sheet contains alphabet leter, when I fetch the record from price field it shows null value.