本文介绍了我的"AccessKaryawanInsert"收到警告功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

公共类访问Karyawan
公共函数访问KaryawanInsert(ByVal Nik As String,_
ByVal名字作为字符串,_
作为字符串的ByVal Jabatan,作为字符串的ByVal Alamat,_
ByVal Telepon As String)

将myCmd设置为新的OleDbCommand
将myconnection调暗为新的AccessData.DataBaseConnection

myCmd.CommandText =将其插入[Karyawan]" _
& (NIK,FirstName,Jabatan,Alamat,Telepon)值("_
& "&尼克& ","&名& ","&贾巴丹& ""_
& ,"和阿拉马特& ","&电话和电话");"

myCmd.Connection = myconnection.open
myCmd.ExecuteNonQuery()
myconnection.close()
最终功能
End Class

Public Class AccessKaryawan
Public Function AccessKaryawanInsert(ByVal Nik As String, _
ByVal FirstName As String, _
ByVal Jabatan As String, ByVal Alamat As String, _
ByVal Telepon As String)

Dim myCmd As New OleDbCommand
Dim myconnection As New AccessData.DataBaseConnection

myCmd.CommandText = "Insert Into [Karyawan]" _
& " (NIK,FirstName,Jabatan,Alamat,Telepon) Values (" _
& "''" & Nik & "'', ''" & FirstName & "'',''" & Jabatan & "''" _
& ", ''" & Alamat & "'', ''" & Telepon & "'') ;"

myCmd.Connection = myconnection.open
myCmd.ExecuteNonQuery()
myconnection.close()
End Function
End Class

推荐答案


这篇关于我的"AccessKaryawanInsert"收到警告功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 19:53