1

i'm using visual studio(VB) and i had a problem,

i am using Microsoft.Office.Interop.Excel to read the data from excel,

--Students_Table--
id_S | Name | Sex
12      john   M

---Excel file------
name | address
john   NY

-----the table where uploaded excel file saved--

id_u | id-S | Scor |
1      12        30

i want to get the Id_S from "John"(excel file), i tried using the dataset with query

select Id_P from Students_Table where (Name =: Name)

and then check fillBy & GetBy

my vb code :

Dim ta As New Students_TableAdapters.StudentsTableAdapter
Dim DataID as Integer
if ta.fillBy(ExlRead.Value) <> 0 then
DataId = ta.fillBy(ExlRead.Value)
else 
exception("The Name Cannot Found on Database")
end if

i use breakpoint to check those and i found an error message

"ORA-01722: invalid number"

(i'm using oracle database)

if i pointed my cursor to the ta.fillBy it shows Public Overridalle Overload Function FillBy(Name as string) as decimal?

note : I'am a newbie using Oracle Database

4

1 回答 1

0

代替

ta.fillBy(ExlRead.Value)

经过

CInt(ta.fillBy(CInt(ExlRead.Value)))
于 2012-04-27T14:24:12.057 回答