29-06-15, 07:25 PM
30-06-15, 04:44 PM
للرفع شباب
المشكله ان الكود عندي لكن فية مشكله
المشكله ان الكود عندي لكن فية مشكله
30-06-15, 08:30 PM
هذا المثال بعد التعديل ان شاء الله يكون حسب المطلوب
02-07-15, 12:30 PM
اشكرك اخي المبرمج المحترف جدا وجعله عملك هذا في ميزان حسناتك لانك حللت المشكله لدي
لكن في مشكله انه عند البحث بأسم الطفل او رقمه تظهر خانه رقم الطفل رقم 1 دائما
لكن في مشكله انه عند البحث بأسم الطفل او رقمه تظهر خانه رقم الطفل رقم 1 دائما
05-07-15, 02:29 PM
شكرا شباب حللت المشكله ووجدت الكود المناسب يعد حهد كبير
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim oledbcom As New OleDbCommand
Dim oledbdata As New OleDbDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim sqlstring As String
'Button2.Enabled = False
If TextBox1.Text.Trim = Nothing Then
MsgBox("fgfg")
TextBox1.Focus()
Exit Sub
End If
con = Getconnect()
sqlstring = Nothing
If TextBox1.Text <> Nothing Then
Select Case ComboBox1.SelectedIndex
Case 0
sqlstring = "child.id =" & TextBox1.Text & ""
Case 1
sqlstring = "child.Name like '%" & TextBox1.Text & "%' "
'Case 2
' sqlstring = "employees.Tel =" & TextBox1.Text & ""
End Select
End If
Try
oledbcom = con.CreateCommand
oledbcom.CommandText = "select * from child where " & sqlstring
oledbdata.SelectCommand = oledbcom
oledbdata.Fill(ds, "child")
DataGridView2.DataSource = ds
DataGridView2.DataMember = "child"
DataGridView2.ReadOnly = True
Catch ex As Exception
End Try
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim oledbcom As New OleDbCommand
Dim oledbdata As New OleDbDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Dim sqlstring As String
'Button2.Enabled = False
If TextBox1.Text.Trim = Nothing Then
MsgBox("fgfg")
TextBox1.Focus()
Exit Sub
End If
con = Getconnect()
sqlstring = Nothing
If TextBox1.Text <> Nothing Then
Select Case ComboBox1.SelectedIndex
Case 0
sqlstring = "child.id =" & TextBox1.Text & ""
Case 1
sqlstring = "child.Name like '%" & TextBox1.Text & "%' "
'Case 2
' sqlstring = "employees.Tel =" & TextBox1.Text & ""
End Select
End If
Try
oledbcom = con.CreateCommand
oledbcom.CommandText = "select * from child where " & sqlstring
oledbdata.SelectCommand = oledbcom
oledbdata.Fill(ds, "child")
DataGridView2.DataSource = ds
DataGridView2.DataMember = "child"
DataGridView2.ReadOnly = True
Catch ex As Exception
End Try