I am using the library DocumentFormat.OpenXml to read values of a table in Excel with specific column names, for example "Name", "CAS" etc. An snippet of my code is as follows:
Dim cookie1 As New HttpCookie("cn" & j + 1)
cookie1.Value = dt.Rows(j)("Name").ToString()
cookie1.Expires = DateTime.Now.AddDays(2)
Response.Cookies.Add(cookie1)
j is an integer iterating from 0 to number of columns -1. Even though the columns are explicitly named, it reads wrong values, for example in cookie cn2 instead of reading the second row of the column Name it reads the second row of columns CAS. dt is a DataTable() object. Any help to solve this would be appreciated.