my datagridview load code
my dataset update class
my dataset update button
i get Conversion from string "Kisi_Adres" to type 'Integer' is not valid.
Why is trying to convert i dont under stand
my datagridview columns
VB.NET:
Private Sub frm_kullanicilar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.DataSource = kisi.GetDataset
DataGridView1.DataMember = "kisiler"
End Sub
VB.NET:
my dataset get code
Public Function GetDataset() As DataSet
Dim ds As DataSet = New DataSet
Dim da As SqlDataAdapter = con.ExecAdapter("select * from kisiler")
da.Fill(ds, "kisiler")
Return ds
End Function
my dataset update class
VB.NET:
Public Sub UpdateDataset(ByVal ds As DataSet)
Dim sqlUpdate As String = "Update (kisiler) SET Kisi_adi = @p2, Kisi_soyadi = @p3, Kisi_Tel = @p4, Kisi_Derece = @p5, Kisi_adres = @p6, Kisi_kayit_tarihi = @p7 WHERE (Kisi_ID = @p1)"
Dim sqlDelete As String = "DELETE FROM Kisiler WHERE (Kisi_ID = @p1)"
Dim sqlInsert As String = "INSERT INTO Kisiler (Kisi_adi, Kisi_soyadi, Kisi_Tel, Kisi_Derece, Kisi_adres, Kisi_kayit_tarihi) VALUES (@p1,@p2,@p3,@p4,@p5,@p6)"
Dim cmdInsert As SqlCommand = con.ExecCommand(sqlInsert)
cmdInsert.Parameters.Add("@p1", SqlDbType.Int, 50, "kisi_ID")
cmdInsert.Parameters.Add("@p2", SqlDbType.VarChar, 50, "Kisi_adi")
cmdInsert.Parameters.Add("@p3", SqlDbType.VarChar, 50, "Kisi_soyadi")
cmdInsert.Parameters.Add("@p4", SqlDbType.VarChar, 50, "Kisi_tel")
cmdInsert.Parameters.Add("@p5", SqlDbType.VarChar, 50, "Kisi_derece")
cmdInsert.Parameters.Add("@p6", SqlDbType.NText, "Kisi_Adres")
cmdInsert.Parameters.Add("@p7", SqlDbType.Date, "Kisi_kayit_tarihi")
Dim cmdDelete As SqlCommand = con.ExecCommand(sqlDelete)
cmdDelete.Parameters.Add("@p1", SqlDbType.Int, 50, "kisi_ID")
Dim cmdUpdate As SqlCommand = con.ExecCommand(sqlUpdate)
cmdUpdate.Parameters.Add("@p1", SqlDbType.Int, 50, "kisi_ID")
cmdUpdate.Parameters.Add("@p2", SqlDbType.VarChar, 50, "Kisi_adi")
cmdUpdate.Parameters.Add("@p3", SqlDbType.VarChar, 50, "Kisi_soyadi")
cmdUpdate.Parameters.Add("@p4", SqlDbType.VarChar, 50, "Kisi_tel")
cmdUpdate.Parameters.Add("@p5", SqlDbType.VarChar, 50, "Kisi_derece")
cmdUpdate.Parameters.Add("@p6", SqlDbType.NText, "Kisi_Adres")
cmdUpdate.Parameters.Add("@p7", SqlDbType.Date, "Kisi_kayit_tarihi")
Dim da As SqlDataAdapter = New SqlDataAdapter
da.InsertCommand = cmdInsert
da.UpdateCommand = cmdUpdate
da.DeleteCommand = cmdDelete
da.Update(ds, "kisiler")
ds.AcceptChanges()
End Sub
my dataset update button
VB.NET:
Private Sub Kaydet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kaydet.Click
kisi.UpdateDataset(DirectCast(DataGridView1.DataSource, DataSet))
End Sub
i get Conversion from string "Kisi_Adres" to type 'Integer' is not valid.
Why is trying to convert i dont under stand
my datagridview columns