条件表达式错误中的数据类型不匹配

时间:2014-02-15 12:44:46

标签: vb.net

Imports System.Data
Imports System.Data.OleDb


Public Class Form1
Dim baglan As New OleDbConnection("Provider=Microsoft.ACE.Oledb.12.0; Data Source=db.accdb")
Dim tur, tutar, sql As String


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub


 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    sql = "insert into gelir (tur,tutar) VALUES ('" & tur & "', '" & tutar & "')"
    Dim komut As New OleDbCommand
    komut.Connection = baglan
    komut.CommandText = sql
    baglan.Open()
    komut.ExecuteNonQuery()
    MessageBox.Show("Geliriniz Kaydedildi")
    baglan.Close()
 End Sub
End Class

我认为问题出在sql string中。

0 个答案:

没有答案