01/04/2013
SCRIPCODE SCRIP NAME CAPITAL(No. of shares in lacs)
500002 ABB Ltd. 2119.08375
500003 Aegis Logistics Ltd. 334.29687
I want to read data from above excel
Date is seperately in above excel below that are col names and below that are values for column.
How can i read data from excel where only val for Date column is there?
used below code to read
public void impPennyStockBSEBulkFile(string FilePath, int eximID)
{
try
{
DataSet ds = o_Cls_Utility.ReadExcelToDataSet(FilePath, "SHEET1", "F3", true);
DateTime[] dDate = (from row in ds.Tables[0].AsEnumerable()
select Convert.ToDateTime(row["0"])).ToArray();
string[] strSCRIP_CODE = ds.Tables[0]
.AsEnumerable()
.Select(row => row.Field<string>("SCRIPCODE").Trim())
.ToArray();
string[] strSCRIP_NAME = ds.Tables[0]
.AsEnumerable()
.Select(row => row.Field<string>("SCRIP NAME").Trim())
.ToArray();
double[] dCAPITAL = (from row in ds.Tables[0].AsEnumerable()
select Convert.ToDouble("CAPITAL")).ToArray();
int[] neximID = (from row in ds.Tables[0].AsEnumerable()
select Convert.ToInt32(eximID)).ToArray();
OracleConnect o_Cls_OracleConnect = new OracleConnect();
o_Cls_OracleConnect.OracleCommand_BulkInsert_PreInit();
o_Cls_OracleConnect.OracleCommand_Date_AddParameters(0, "sBulkDate", dDate);
o_Cls_OracleConnect.OracleCommand_Varchar2_AddParameters(1, "sScripCode", strSCRIP_CODE);
o_Cls_OracleConnect.OracleCommand_Varchar2_AddParameters(2, "sScripName", strSCRIP_NAME);
o_Cls_OracleConnect.OracleCommand_Double_AddParameters(3, "sCapital", dCAPITAL);
o_Cls_OracleConnect.OracleCommand_Number_AddParameters(4, "nEXIM_ID", neximID);
int recordsInserted = o_Cls_OracleConnect.OracleCommand_BulkInsert(strSCRIP_CODE.Length, "SP_PENNYSTOCK_BSE_BULKFILE_IMP");
o_Cls_OracleConnect.Dispose();
}
and in dataset only below val are shown
SCRIPCODE SCRIP NAME CAPITAL(No. of shares in lacs)
500002 ABB Ltd. 2119.08375
500003 Aegis Logistics Ltd. 334.29687