新版的ODBC driver好像不支援了(不確定)
因此我改用oledb
不過記得裝一個檔案叫 vfpoledb.exe
否則會發生錯誤
Dim ora_Conn As New OleDbConnection
Dim dt As New DataTable
Dim connStr As String = "provider=vfpoledb;data Source=c:\"
ora_Conn.ConnectionString = connStr
ora_Conn.Open()
Dim sql As String
sql = "insert into R991025.dbf(SUPPLIER,SUPPMAN,ITEMNO,KINDX,GRADE,PCS,QTYOK,PACKOK,TRN_WAY)"
sql = sql + " VALUES('1','2','3','4','5',6,7,8,'9')"
'sql = "select * from R991025.dbf"
Dim ora_cmd As OleDbCommand = New OleDbCommand(sql, ora_Conn)
ora_cmd = New OleDbCommand(sql, ora_Conn)
ora_cmd.ExecuteNonQuery()
'dt.Load(ora_cmd.ExecuteReader)
Me.GridView1.DataSource = dt
Me.GridView1.DataBind()
沒有留言:
張貼留言