تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
طلب كود
#3
تفضل اخي 
كود :
Private Sub fill_combobox_grid()
       Try
           'فحص الاتصال بقاعدة البيانات
           If SQL.conn.State = ConnectionState.Open Then
               SQL.conn.Close()
           End If
           SQL.conn.Open()
           Dim cmd As New SqlCommand()
           cmd.Connection = SQL.conn
           cmd.CommandText = "select DISTINCT con_id from contracts where cust_id=@cust_id"
           cmd.Parameters.AddWithValue("@cust_id", DataGrid_monthly.SelectedRows(0).Cells(3).Value)
           Dim dr As SqlDataReader = cmd.ExecuteReader

           While dr.Read
               Dim esection As String = dr.Item(0)
   End While
        combobox1.Items.add(esection )
 dr.Close()
           SQL.conn.Close()
       Catch ex As SqlException
           MsgBox(ex.Message, MsgBoxStyle.Critical, "SQL Error")
       Catch ex As Exception
           MsgBox(ex.Message, MsgBoxStyle.Critical, "General Error")
       End Try
   End Sub
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
طلب كود - بواسطة hikmat - 25-09-17, 05:49 AM
RE: طلب كود - بواسطة سعود - 25-09-17, 09:22 AM
RE: طلب كود - بواسطة Rabeea Qbaha - 25-09-17, 03:46 PM
RE: طلب كود - بواسطة wale90 - 25-09-17, 04:07 PM

التنقل السريع :


يقوم بقرائة الموضوع: