Hi
I am trying to import data from excel sheet to a data table in sql express which is used to build a candle stick graph. Just need your opinion if this code fine or any modification is needed.
SqlDataReader dr;
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Database=D:\data.xlsx;Initial Catalog=ExcelDB;" + @"; Extended Properties =""Excel 8.0;HDR=Yes;IMEX=1;ImportMiexd Type=text;TypeGuessRows=0;Integrated Security=true""";
SqlCommand cmd = new SqlCommand("Select StockName,Date,Open,High,Low,Close from [Sheet1$]",con);
cmd.Connection = con;
try
{
con.Open();
dr = cmd.ExecuteReader();
...
Go to the complete details ...