How do I search the database for data and return a True or false?
I am trying to add code to check if the information in the first two TextBoxes(FirstName and LastName) is already in the database(so that I can just update it) or if the TextBoxes contain new names so that it will continue to add a new DataRow…… Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click ‘Create a variable for the child’s photo’ Dim ChildPhoto As String ChildPhoto = ChildPhotoPB.ImageLocation ‘Make sure names have been entered’ If TextBox1.Text = “” Or TextBox2.Text = “” Then MessageBox.Show(“Please enter a first and last name.”) Else ‘Copy the information from the variables to the database’ Dim newChildRow As Child_Information_DatabaseDataSet.Child_InformationRow newChildRow = CCPD.Main.MainUC1.Child_Information_DatabaseDataSet.Child_Information.NewChild_InformationRow newChildRow.FirstName = TextBox1.Text : newChildRow.LastName = TextBox2.Text : newChildRow.DOB = DateTimePicker1.Text : newChildRow.FDOC = DateT
Related Questions
- Will DSS allow Users to query the database directly; ie., can I pass DSS a parameter and have it return the data similar to a query written against MIS?
- My site uses a search engine to search a database and return products for sale. Will Americart work with this?
- How do I search the database for data and return a True or false?