J
J_Mohan
Guest
Hi friends,
I am trying to add numerical value through parameter in access table, I receive aforesaid message. what will be the solution, I have tried as follows:
Sub DataTrans()
Dbconnection.Open()
MasterReader = MasterCmd.ExecuteReader()
Try
While MasterReader.Read()
IntArr(0) = (MasterReader("Sap_No"))
IntArr(1) = (MasterReader("DesigIndex"))
IntArr(2) = (MasterReader("CurrYear"))
StrArr(0) = (MasterReader("CPF_No".ToString))
StrArr(1) = (MasterReader("Name".ToString))
StrArr(2) = (MasterReader("Designation".ToString))
LvMasterCmd.CommandText = "INSERT INTO LeaveMaster (CPF_No, Name, Designation, MNT, YR, LeaveStatus,CurrYear,Sap_No,DesigIndex)" &
"VALUES (@CPF_No, @name, @Designation, @MNT, @YR, @LeaveStatus, CurrYear, @Sap_No, @DesigIndex) ; "
Try
LvMasterCmd.Parameters.AddWithValue("@Sap_No", IntArr(0))
LvMasterCmd.Parameters.AddWithValue("@DesigIndex", IntArr(1))
LvMasterCmd.Parameters.AddWithValue("@CurrYear", IntArr(2))
LvMasterCmd.Parameters.AddWithValue("@CPF_No", StrArr(0).ToString)
LvMasterCmd.Parameters.AddWithValue("@name", StrArr(1).ToString)
LvMasterCmd.Parameters.AddWithValue("@Designation", StrArr(2).ToString)
LvMasterCmd.Parameters.AddWithValue("@MNT", CmbMonth.Text)
LvMasterCmd.Parameters.AddWithValue("@YR", CmbYear.Text)
LvMasterCmd.Parameters.AddWithValue("@LeaveStatus", "N")
LvMasterCmd.ExecuteNonQuery()
LvMasterCmd.Parameters.Clear()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Dbconnection.Close()
End Sub
Continue reading...
I am trying to add numerical value through parameter in access table, I receive aforesaid message. what will be the solution, I have tried as follows:
Sub DataTrans()
Dbconnection.Open()
MasterReader = MasterCmd.ExecuteReader()
Try
While MasterReader.Read()
IntArr(0) = (MasterReader("Sap_No"))
IntArr(1) = (MasterReader("DesigIndex"))
IntArr(2) = (MasterReader("CurrYear"))
StrArr(0) = (MasterReader("CPF_No".ToString))
StrArr(1) = (MasterReader("Name".ToString))
StrArr(2) = (MasterReader("Designation".ToString))
LvMasterCmd.CommandText = "INSERT INTO LeaveMaster (CPF_No, Name, Designation, MNT, YR, LeaveStatus,CurrYear,Sap_No,DesigIndex)" &
"VALUES (@CPF_No, @name, @Designation, @MNT, @YR, @LeaveStatus, CurrYear, @Sap_No, @DesigIndex) ; "
Try
LvMasterCmd.Parameters.AddWithValue("@Sap_No", IntArr(0))
LvMasterCmd.Parameters.AddWithValue("@DesigIndex", IntArr(1))
LvMasterCmd.Parameters.AddWithValue("@CurrYear", IntArr(2))
LvMasterCmd.Parameters.AddWithValue("@CPF_No", StrArr(0).ToString)
LvMasterCmd.Parameters.AddWithValue("@name", StrArr(1).ToString)
LvMasterCmd.Parameters.AddWithValue("@Designation", StrArr(2).ToString)
LvMasterCmd.Parameters.AddWithValue("@MNT", CmbMonth.Text)
LvMasterCmd.Parameters.AddWithValue("@YR", CmbYear.Text)
LvMasterCmd.Parameters.AddWithValue("@LeaveStatus", "N")
LvMasterCmd.ExecuteNonQuery()
LvMasterCmd.Parameters.Clear()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Dbconnection.Close()
End Sub
Continue reading...