datatable difficulties in query with database

  • Thread starter Thread starter Houssem12
  • Start date Start date
H

Houssem12

Guest
HI

when i make a select query and transfer it to a datatable

it count all the rows in the query exactly like i wanted

but also it take the same rows many time

like 3 times

i don't understand how

the number of rows is 310 but in my case more than that

Dim cmdDLigne2 As New SqlCommand("select * from DL_Ligne_Table where Numero=@Numero", cn)
With cmdDLigne2.Parameters

.Add("@Numero", SqlDbType.NVarChar).Value = (TextBox1.Text)

End With
Dim adapt As New SqlDataAdapter(cmdDLigne2)
Dim tb As New DataTable
adapt.Fill(tb)
MessageBox.Show("longueur de table = " & tb.Rows.Count)
DataGridView2.DataSource = tb


please help

Continue reading...
 
Back
Top