![]() | |
| | #1 (permalink) |
| Cevizci Üyelik Tarihi: 06/2003
Mesaj: 273
|
Merhaba, Visual Studio 2008 kullanıyorum recordset ile kayıt ekleyebiliyorum. ve kayıt sorgulayabiliyorum. (Kayıt ederken zaten kayıtlı) Ama textbox'a veri girip arama yaptığımda sorun çıkıyor. Asp biliyorum o yüzden recordset ve ado kullanmak hoşuma gitti ama sorun yaşıyorum problem nerdedir acaba. Sorunlu Kod: Kod: Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
sql = "select * from ogrenci where okulno=" & TextBox4.Text
rs = baglanti.Execute(sql)
TextBox1.Text = rs("adisoyadi").ToString
'TextBox2.Text = "Ahmet" 'rs("adisoyadi")
'TextBox3.Text = rs("sinif")
'If Err() Then
'MsgBox("aradığınız kayıt bulunamadı")
'GoTo 10
'End If
TextBox1.Enabled = True
TextBox1.BackColor = Color.AliceBlue
TextBox2.Enabled = True
TextBox2.BackColor = Color.AliceBlue
TextBox3.Enabled = True
TextBox3.BackColor = Color.AliceBlue
TextBox1.Focus()
rs = Nothing
End Sub
Tam Kodu Kod: Public Class Form1
Dim baglanti
Dim rs
Dim sql
Dim id
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
baglanti = New ADODB.Connection
baglanti.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & "c:\uygulama\data.mdb")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
TextBox1.Enabled = True
TextBox1.BackColor = Color.Yellow
TextBox2.Text = ""
TextBox2.Enabled = True
TextBox2.BackColor = Color.CadetBlue
TextBox3.Text = ""
TextBox3.Enabled = True
TextBox3.BackColor = Color.Chocolate
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If IsNumeric(TextBox1.Text) = True Or TextBox1.Text <> "" Then
sql = "select okulno from ogrenci where okulno=" & TextBox1.Text
rs = baglanti.Execute(sql)
If Not rs.EOF Then
MsgBox("Böyle bir Kayıt Var")
rs = Nothing
GoTo 10
Else
rs = Nothing
End If
sql = "insert into ogrenci(okulno,adisoyadi,sinif) values(" & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "')"
baglanti.Execute(sql)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
Else
MsgBox("Okul numarası Strign değer alamaz veya okul numarası boş olamaz")
10: End If
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
baglanti.Close()
baglanti = Nothing
End
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
sql = "select * from ogrenci where okulno=" & TextBox4.Text
rs = baglanti.Execute(sql)
TextBox1.Text = rs("adisoyadi").ToString
'TextBox2.Text = "Ahmet" 'rs("adisoyadi")
'TextBox3.Text = rs("sinif")
'If Err() Then
'MsgBox("aradığınız kayıt bulunamadı")
'GoTo 10
'End If
TextBox1.Enabled = True
TextBox1.BackColor = Color.AliceBlue
TextBox2.Enabled = True
TextBox2.BackColor = Color.AliceBlue
TextBox3.Enabled = True
TextBox3.BackColor = Color.AliceBlue
TextBox1.Focus()
rs = Nothing
End Sub
End Class
Birde Visual Studio 2008 ve database olayları ilgili bir kitap veya kaynak varmı acaba? |
| | |
![]() |
| Bookmarks |
| Seçenekler | |
| |
Benzer Konular | ||||
| Konu | Konuyu açana göre | Forum | Cevap | En Son Mesaj |
| Visual Web Developer 2008 fırından çıktı :-) | anov | ASP | 18 | 18/06/2008 12:30 |
| visual studio 2008 sorunu | lcy | C# | 1 | 31/01/2008 02:57 |
| Visual Studio 2005 ile Visual Studio 6.0 da derlenmis lib kullanma sorunu | aerdem | C / C++ | 2 | 31/03/2007 14:26 |
| visual studio.... | totoloji | Visual Basic | 3 | 01/10/2004 20:53 |
| Visual Studio.NET??? | limonabi | Visual Basic | 13 | 03/06/2004 10:55 |
| Reklamlar & Desteklenenler | |
| Hassas Valf | Hassas Kaplama | Antalyamız | Gazete | Ticari Bilişim | Hakan Müştak | Rüya Tabirleri | Kadın | Hastalıklar | Cepte msn ve e-posta | Webmaster | Antalya Aupair | Turkish Property Antalya | Forum | Chat | Perde | Adsl | Araba | bolindir.com | guncelle.com | livescore | Web Tasarım | evden eve nakliyat | forum | evden eve | sohbet | Resimcim| Kalifiye İnsan Kaynakları | Web Tasarım | Oyun | Yusuf KOÇ | Akın Yorulmaz | şiir | UFO | Web Tasarım | Oyunlar | Canlı Tv | |