Public Sub get_data() cn.Open() Dim dt As New DataTable("shakhes") Dim rs As New SqlDataAdapter("select * from shakhes where sal_tadieh='" & TextBoxX1.Text & "' and mah_tadieh='" & ComboBox1.SelectedItem & "'", cn) rs.Fill(dt) ShakhesDataGridView.DataSource = dt ShakhesDataGridView.Refresh() Label1.Text = dt.Rows.Count rs.Dispose() cn.Close( If Val(Label1.Text) = 1 Then Dim i As Integer i = ShakhesDataGridView.CurrentRow.Index TextBoxX2.Text = ShakhesDataGridView.Item(2, i).Value End If End Sub
cn.Close(
cn.Close()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)