I have a column in the database called "UOM" and I want to display it beside a value called "Qty" via opening an SQL query. But it showed an error saying "No data exists for the row/column". This is my codes.
Dim Oledbconn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:/inetpub/wwwroot/ProjectIntegrated/Inven.mdb;Persist Security Info=True")
Dim cmd As New OleDbCommand
Dim reader As OleDbDataReader
cmd.CommandText = "Select UOM FROM Master WHERE IPN = '" & Session("PO IPN")(SummaryCounter) & "'"
cmd.CommandType = CommandType.Text
cmd.Connection = Oledbconn
Oledbconn.Open()
reader = cmd.ExecuteReader()
oSheet.Range("F" & ExcelCounter).Value = "" & Session("PO Qty") + reader.Item("UOM") + (POTableCounter)
oSheet.Range("F" & ExcelCounter).HorizontalAlignment = -4108
Oledbconn.Close()