allbluekos
allbluekos
采纳率88.5%
2016-05-31 00:32 阅读 1.5k
已采纳

已经保存成功但是不弹出提示框,请帮忙看看,谢谢!

 mycn.ConnectionString = "Data Source=" & ControlC.TextBox2.Text & ";Initial Catalog=" & ControlC.TextBox3.Text & ";uid=windmill;pwd=123"
        mycom.CommandText = "if exists(select PdOID  from PdO  where PdOID='" & TextBox3.Text & "') begin update PdO set pdoclientNM='" & TextBox4.Text & "', pdofilldate='" & DateTimePicker3.Value & "',pdoCFdate='" & DateTimePicker4.Value & "',pdoCLdate='" & DateTimePicker5.Value & "',pdofillMan='" & TextBox5.Text & "',pdoCFMan='" & TextBox6.Text & "',pdoCLMan='" & TextBox7.Text & "',pdoFLteam='" & TextBox8.Text & "' where PdOID='" & TextBox3.Text & "' end else begin insert into PdO values('" & TextBox3.Text & "','" & TextBox4.Text & "','" & DateTimePicker3.Value & "','" & DateTimePicker4.Value & "','" & DateTimePicker5.Value & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "') end"
        mycom.Connection = mycn

        Try
            mycn.Open()
            Dim mysqlreader As Data.SqlClient.SqlDataReader = mycom.ExecuteReader
            'mycom.ExecuteNonQuery()
            If mycom.ExecuteNonQuery() > 0 Then
                MessageBox.Show("数据保存成功!")
            End If
        Catch ex As Exception
        Finally
            mycn.Close()
        End Try

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    qq_28199467 夜空中最亮的那颗星 2016-06-01 15:34

    MessageBox.Show("数据保存成功!") 这句是弹框 删了就不会弹出提示框

    点赞 1 评论 复制链接分享

相关推荐