hello
my first topic
i am creating an application vb.net using sql server 2005 database.
i created a form with textboxes and comboboxes and also the table adapter e.t.c
for the saving the adding data i use the following function
then when i click the save button
then
there is small form which is open when you click
a search com button
here is my problem
i can not find a standard way to search with parameteres for example the lastname
i populate in a combobox all the lastnames .you choose one and then you click ok.
what after that.
how then i can populate in the form the data in the rest 14 textboxes using lastname
my first topic
i am creating an application vb.net using sql server 2005 database.
i created a form with textboxes and comboboxes and also the table adapter e.t.c
for the saving the adding data i use the following function
VB.NET:
Private Function Save() As Boolean
Dim saved As Boolean = False
If Me.myDataSet.HasChanges Then
Try
Dim mytableUpdates() As DataRow = Me.mydataset.mytable.Select("", "", DataViewRowState.Added Or DataViewRowState.ModifiedCurrent)
'Button1.Visible = True
Me.myTableAdapter.Update(mytableUpdates)
saved = True
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End If
Return saved
End Function
VB.NET:
Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Validate()
Me.mytableBindingSource.EndEdit()
If Me.Save Then
MsgBox("table Updated Succesfully")
Else
MsgBox("Update failed")
End If
End Sub
then
there is small form which is open when you click
a search com button
here is my problem
i can not find a standard way to search with parameteres for example the lastname
i populate in a combobox all the lastnames .you choose one and then you click ok.
what after that.
VB.NET:
Dim PrsView As DataView = mydatasett.mytable.DefaultView
PrsView.RowStateFilter = DataViewRowState.OriginalRows
PrsView.RowFilter = ComboBox1.Text ([COLOR="Red"]there is a mistake[/COLOR] )
Last edited by a moderator: