Ciao a tutti, ho creato un piccola progetto che mi legge i dati di un data base fatto su acces. Il problemma e che vorrei inserire una funzione che quando il dato non viene trovato mi compare la scritta (dfato non trovato). Qualcuno sa come migliorare questo codice? mi sa dare qualche consiglio? sotto mettero il codi che ho scritto fino ad ora:
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'DATADataSet.Tabella1' table. You can move, or remove it, as needed.
Me.Tabella1TableAdapter.Fill(Me.DATADataSet.Tabell a1)
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
End Sub
Private Sub Form2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
If e.KeyData = Keys.Enter Then Me.Button1.PerformClick()
End Sub
Private Sub Tabella1BindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.Tabella1BindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DATADataSet)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Testo As String
Testo = TextCerca.Text
Me.Tabella1TableAdapter.FillBycodicef(DATADataSet. Tabella1, "%" + Testo + "%")
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextCerca.Text = ""
TextCerca.Focus()
End Sub
End Class