错误删除我的vb 2012中的命令代码,我正在使用sql server 2012 [英] error delete's command code in my vb 2012 and i'm using sql server 2012

查看:62
本文介绍了错误删除我的vb 2012中的命令代码,我正在使用sql server 2012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误来自 sqlda ,我很困惑解决它,消息是

'错误1重载解析失败,因为无法访问'新'可以使用以下参数调用:

'Public Sub New(selectCommandText As String,selectConnection As System.Data.SqlClient.SqlConnection)':'LatihanDBKlinik.KlinikGigiDataSet'类型的值无法转换为'System .Data.SqlClient.SqlConnection'。

'Public Sub New(selectCommandText As String,selectConnectionString As String)':'LatihanDBKlinik.KlinikGigiDataSet'类型的值不能转换为'String'。 E:\ Kuliah \ Skripsi \ Program =\\ LatihanDBKlinik \ LatihanDBKlinik \Form1.vb 43 17 LatihanDBKlinik'



我错过了什么或者我是业余爱好者?请指教。任何帮助都会很棒。谢谢!







the error come from sqlda, i'm confused to solve it, the message is
'Error 1 Overload resolution failed because no accessible 'New' can be called with these arguments:
'Public Sub New(selectCommandText As String, selectConnection As System.Data.SqlClient.SqlConnection)': Value of type 'LatihanDBKlinik.KlinikGigiDataSet' cannot be converted to 'System.Data.SqlClient.SqlConnection'.
'Public Sub New(selectCommandText As String, selectConnectionString As String)': Value of type 'LatihanDBKlinik.KlinikGigiDataSet' cannot be converted to 'String'. E:\Kuliah\Skripsi\Program\LatihanDBKlinik\LatihanDBKlinik\Form1.vb 43 17 LatihanDBKlinik'

Am I missing something or i'm a amateur? Please advise. Any help would be great. Thank you!



Private Sub bt_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_hapus.Click
       Try
            Dim sqlda As New SqlClient.SqlDataAdapter("Delete from tabelanggota where Id=" & Me.No_Rkm_MdsTextBox.Text, Me.KlinikGigiDataSet)
            sqlda.Fill(dbpasien, "tabelanggota")
            MsgBox("Data telah berhasil dihapus")
            bersih()
            pasif()
            normal()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

推荐答案

正如Phantom所说,当你需要一个SqlConnection时,你正在传递Me.KlinikGigiDataSet。
As Phantom said, you are passing in Me.KlinikGigiDataSet when it expects a SqlConnection.


这篇关于错误删除我的vb 2012中的命令代码,我正在使用sql server 2012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆