在数据库表中插入行

时间:2016-01-19 16:08:17

标签: vb.net ado.net ado.net-entity-data-model

我想知道我是否正在使用oledbcommand在表中插入行的权限步骤。 这是我的代码:

        strSQL2 = " SELECT * FROM GESTHANDNET2015v1.dbo.TabLoc "
        Dim insere1 As New OleDbCommand(strSQL2, connOracle)
        Dim drinsere As OleDbDataReader = insere1.ExecuteReader()
        drinsere.Read()
        lertabela7 = New OleDbCommand(strSQL2, connOracle)
        mysetinsere = lertabela7.ExecuteReader
        If mysetinsere.HasRows Then

            strSQL = " Insert into GESTHANDNET2015v1.dbo.Tabloc where GESTHANDNET2015v1.dbo.Tabloc.Codprov=" & mysetinsere!codprov
            strSQL = strSQL & "; and GESTHANDNET2015v1.dbo.Tabloc.codmun=" & mysetinsere!codmun
            strSQL = strSQL & "; and GESTHANDNET2015v1.dbo.Tabloc.codloc=" & mysetinsere!codloc
            strSQL = strSQL & "; and GESTHANDNET2015v1.dbo.Tabloc.descrloc= " & mysetinsere!descrloc
            vValues = ""
            vValues = 1
            vValues = vValues & "1"
            vValues = vValues & "999"
            vValues = vValues & "Alocação Temporária"

        End If

0 个答案:

没有答案