Results 1 to 4 of 4

Thread: How to flush data from Tables?

  1. #1
    Rajendra.Penumalli is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    Jul 2012
    Posts
    6
    Reputation
    0

    How to flush data from Tables?

    Hi All,
    Currently I am automating a project with Silk Test Tool using VB.Net Scripting.
    Currently i am hard coding the configuration values in Test Script.
    Some times I need to flush(i mean i need to delete all the data in MySQL DB) data from Data Base from my VB.Net Test Script.
    I don't know how to achieve this,Anybody can help in this ?
    If possible please provide some sample Code...
    Thanks,
    Rajendra

  2. #2
    Herman is offline VB.NET Forum Miyagee
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Location
    Montreal, QC, CA
    Posts
    448
    Reputation
    346
    Just restore a backup of a clean DB when you need it.

  3. #3
    Rajendra.Penumalli is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    Jul 2012
    Posts
    6
    Reputation
    0
    how achieve this using vb.net code?

    Quote Originally Posted by Herman View Post
    Just restore a backup of a clean DB when you need it.

  4. #4
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,334
    Reputation
    1543
    You do it the same way you perform any other interaction with a database, i.e. you create a connection and Open it and then create a command and execute it. In this case the SQL will be a RESTORE DATABASE or the like. That's not a query so you call ExecuteNonQuery. As for the SQL itself, that's not anything to do with VB.NET. You should consult the MySQL documentation for that. As always, make sure that the SQL works in a management tool first.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking