0 down vote favorite
I have a problem, what i want is when the user enters data in the textbox, it needs to compare the entered textbox value like ,,name, with value ,,name,, in dataset.
If name exists, It should enter the value in textbox. If not, it should pop up a message box asking user to add new value (name).
I only have code how to fill dataset. Because I do not know where and how to begin.I hope you understand me. Im using vb.net and sql server 2008.
Public Function gatherSelect() Main.con.Close() Main.con.Open() exe = "basicGatherSelect" Dim startTrasaction = Main.con.BeginTransaction Try com = New SqlCommand(exe, Main.con) com.CommandType = CommandType.StoredProcedure com.Transaction = startTrasaction adp.SelectCommand = com adp.Fill(sqlDS) adp.Dispose() com.Dispose() startTrasaction.Commit() GridControl1.DataSource = sqlDS.Tables(0) Main.con.Close()! Catch ex As Exception startTrasaction.Commit() MessageBox.Show(ex.Message) Finally txtName.Text = "" txtStateID.Text = "" End Try End Function