Hi;
I try to get informations from an Access DB. There is tabcontrol. There are some tabstops. If you enter a tabstop it tries to update data in Datagridview. But at the first time you enter to tabstop it normally takes data from database. If you try to take data for a second time you need to do this:

VB Code:
  1. Me.DGW.DataSource = Nothing
  2.         DS.Tables.Clear()
  3.         DS.DataSetName = "NewDataSet"
  4.  
  5.         CN.Close()
  6.  
  7.         CNConnect()
  8.         RS.Open("SELECT * FROM " & TbStok & Ek, CN, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
  9.  
  10.         TakeData()
  11.         ShowData()

and in this function I get the error, which is written in the title:

VB Code:
  1. Private Function TakeData() As Boolean
  2.        
  3.         DS.Tables.Add(TbStok)
  4.         OL.Fill(DS.Tables(TbStok), RS)
  5.         DS.DataSetName = CN.ConnectionString
  6.         DGW.DataSource = DS.Tables(TbStok)
  7.         Return True
  8.  
  9.     End Function
But I clear the tables b4 using takedata function. There was a table with the same name from first taking data but in a second time I clear it b4 taking data again. What shall I do?