Imports System.Data
Public Class Form1
    Dim dt As New DataTable()
    Public Sub recordGrid(ByVal resql As String)
        Dim connStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
                                                        "Data Source = derspro.mdb"
        Dim dataAdapter As New OleDb.OleDbDataAdapter(resql, connStr)
        dataAdapter.Fill(dt)
        dataAdapter.Dispose()
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
        If ComboBox5.Text = "BİLGİSAYAR TEK. VE PROĞRAMLAMA (N.Ö.)" Then
            If RadioButton1.Checked Then
                Dim girilen As String
                Dim sonuc As String
                Dim Sql As String
                Dim hocaadi As String
                Dim uzunluk As Integer
                Dim hoca As String
                Dim saat As Integer
                Dim connStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
                                                                "Data Source = derspro.mdb"
                Sql = "select Pazartesi From btp WHERE'" & ComboBox2.Text & "' "
                Dim dataAdapter As New OleDb.OleDbDataAdapter(sql, connStr)
                dataAdapter.Fill(dt)
                saat = ComboBox2.Text.Substring(0, 1)
                sonuc = dt.Rows(saat)("Pazartesi")
                dataAdapter.Dispose()
                hocaadi = CStr(ComboBox3.Text)
                uzunluk = hocaadi.Length
                hoca = CStr(sonuc.Substring(8, uzunluk))
                girilen = CStr(sonuc.Substring(0, 7))
                If sonuc = " " Then
                    recordGrid("UPDATE btp SET Pazartesi='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                    MsgBox("KAYIT BAŞARILI", 0, "")
                ElseIf girilen = ComboBox4.Text Then
                    MsgBox("BU LABRATUAR KULLANILMAKTADIR", 0, "")
                ElseIf sonuc <> girilen Then
                    If hoca = ComboBox3.Text Then
                        MsgBox("BU HOCANIN BU SAATTE BAŞKA BİR YERE DERSİ VAR", 0, "")
                    ElseIf hoca <> ComboBox3.Text Then
                        recordGrid("UPDATE btp SET Pazartesi='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                        MsgBox("KAYIT BAŞARILI", 0, "")
                    End If
                    End If
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE btp SET Sali='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE btp SET Carsamba='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE btp SET Persembe='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE btp SET Cuma='" & ComboBox4.Text & "  " & ComboBox3.Text & "  " & ComboBox1.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        ElseIf ComboBox5.Text = "BİLGİSAYAR TEK. VE PROĞRAMLAMA (İ.Ö.)" Then
            If RadioButton1.Checked Then
                recordGrid("UPDATE btpi SET Pazartesi='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE btpi SET Sali='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE btpi SET Carsamba='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE btpi SET Persembe='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE btpi SET Cuma='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        ElseIf ComboBox5.Text = "İŞLETME  (N.Ö.)" Then
            If RadioButton1.Checked Then
                recordGrid("UPDATE isletme SET Pazartesi='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE isletme SET Sali='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE isletme SET Carsamba='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE isletme SET Persembe='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE isletme SET Cuma='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        ElseIf ComboBox5.Text = "İŞLETME  (İ.Ö.)" Then
            If RadioButton1.Checked Then
                recordGrid("UPDATE isletmei SET Pazartesi='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE isletmei SET Sali='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE isletmei SET Carsamba='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE isletmei SET Persembe='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE isletmei SET Cuma='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        ElseIf ComboBox5.Text = "HARİTA KADASTRO  (N.Ö.)" Then
            If RadioButton1.Checked Then
                recordGrid("UPDATE harita SET Pazartesi='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE harita SET Sali='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE harita SET Carsamba='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE harita SET Persembe='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE harita SET Cuma='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        ElseIf ComboBox5.Text = "HARİTA KADASTRO  (İ.Ö.)" Then
            If RadioButton1.Checked Then
                recordGrid("UPDATE haritai SET Pazartesi='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton2.Checked Then
                recordGrid("UPDATE haritai SET Sali='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton3.Checked Then
                recordGrid("UPDATE haritai SET Carsamba='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton4.Checked Then
                recordGrid("UPDATE haritai SET Persembe='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            ElseIf RadioButton5.Checked Then
                recordGrid("UPDATE haritai SET Cuma='" & ComboBox1.Text & "  " & ComboBox3.Text & "  " & ComboBox4.Text & "' Where SAAT='" & ComboBox2.Text & "' ")
                MsgBox("KAYIT BAŞARILI", 0, "")
            End If
        End If
    End Sub
    
    
End Class
bunun sonucun da bir veritabanım var burdaki girilen kayıtlar overitabanına kayıt oluyor ve ben bu veritanın da karşılaştırma yapıp bu şekil de ekrana msj vermek istiyorum
				
				
			
			
			
			
			
				
 #1
			
				
			
			
			
			
#1
		
 
	
