S
Sam
I using SqlDataAdapter and I encounter the error as shown as below. Please
assist and guide me on SQLDataAdapter for SQL Insert and Update.
Error Message
---------------
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30188: Declaration expected.
Source Error:
Line 14: Dim oDa As OleDbDataAdapter
Line 15:
Line 16: oConn = New OleDbConnection ("Provider=SQLOLEDB;Data
Source=KULSQL;Initial Catalog=Retire_Benefit;Persist Security Info=True;User
ID=intranet;Password=88")
Line 17: oConn.Open()
Line 18:
Source File: D:\SQLDB\Intranet\WebApp\RetireBenefit\subsystem\process.aspx
Line: 16
Coding
-------
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDB" %>
<script language="VB" runat="server">
'Declare current month as integer
Dim MonthNum as New System.DateTime
Dim month As Integer = MonthNum.Month
Dim oConn As OleDbConnection
Dim oCmd As OleDbCommand
Dim oDa As OleDbDataAdapter
oConn = New OleDbConnection ("Provider=SQLOLEDB;Data
Source=KULSQL;Initial Catalog=Retire_Benefit;Persist Security Info=True;User
ID=intranet;Password=88")
oConn.Open()
oCmd = New OleDbCommand ("Select * from PeriodMonthNum", oConn)
oDa = New OleDbDataAdapter()
oDa.SelectCommand = oCmd
</script>
assist and guide me on SQLDataAdapter for SQL Insert and Update.
Error Message
---------------
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30188: Declaration expected.
Source Error:
Line 14: Dim oDa As OleDbDataAdapter
Line 15:
Line 16: oConn = New OleDbConnection ("Provider=SQLOLEDB;Data
Source=KULSQL;Initial Catalog=Retire_Benefit;Persist Security Info=True;User
ID=intranet;Password=88")
Line 17: oConn.Open()
Line 18:
Source File: D:\SQLDB\Intranet\WebApp\RetireBenefit\subsystem\process.aspx
Line: 16
Coding
-------
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDB" %>
<script language="VB" runat="server">
'Declare current month as integer
Dim MonthNum as New System.DateTime
Dim month As Integer = MonthNum.Month
Dim oConn As OleDbConnection
Dim oCmd As OleDbCommand
Dim oDa As OleDbDataAdapter
oConn = New OleDbConnection ("Provider=SQLOLEDB;Data
Source=KULSQL;Initial Catalog=Retire_Benefit;Persist Security Info=True;User
ID=intranet;Password=88")
oConn.Open()
oCmd = New OleDbCommand ("Select * from PeriodMonthNum", oConn)
oDa = New OleDbDataAdapter()
oDa.SelectCommand = oCmd
</script>