Red Gate forums :: View topic - Can We Insert New Reocrd By Using Ants Load
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Load
ANTS Load forum

Can We Insert New Reocrd By Using Ants Load

Search in ANTS Load forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
jagadeesh_qc



Joined: 01 Sep 2006
Posts: 1

PostPosted: Fri Sep 01, 2006 10:55 am    Post subject: Can We Insert New Reocrd By Using Ants Load Reply with quote

Hi All,

Can We Insert a New Reocrd By Using Ants Load script in Database. If yes What are the steps?


Thank You,
Jagadeesh
Back to top
View user's profile Send private message Send e-mail
Brian Donahue



Joined: 23 Aug 2004
Posts: 6675

PostPosted: Mon Sep 11, 2006 6:43 pm    Post subject: Reply with quote

Hello,

ANTS Load can only make web requests. If you have a web application that does the database updates, you can use ANTS Load as a harness to get it to perform many updates automatically in a short period of time. The software is mainly designed to stress-test websites rather than test their functionality is working properly, however.
Back to top
View user's profile Send private message
tommyjjohnson



Joined: 03 Jan 2007
Posts: 3

PostPosted: Wed Jan 03, 2007 10:34 pm    Post subject: I've accomplished this task very easily Reply with quote

I've used ANTS Load to interact with a database directly, without using my Web site. All you have to do is write VB.Net code to do it. I used this example to test database performance:

Dim con As System.Data.SqlClient.SqlConnection
Dim com As System.Data.SqlClient.SqlCommand
Dim ElapsedTime As TimeSpan

Try
con = New System.Data.SqlClient.SqlConnection("Server=dbtest1;database=nevada;uid=xxxx;pwd=xxxx")
con.Open()
com = New System.Data.SqlClient.SqlCommand(QueryName, con)
com.CommandType = Data.CommandType.StoredProcedure
com.CommandTimeout = 2400
com.ExecuteNonQuery()
Catch ex As Exception
If Me.Id < 2 Then
AntsHelper.Tracker.SendToExternalHtml("c:\loadtest\hyperthreading.htm", ex.ToString(), "&nbsp;")
End If
Result = "ERROR"
Finally
If con.State <> Data.ConnectionState.Closed Then
con.Close()
End If

com.Dispose()
con.Dispose()

ElapsedTime = DateTime.Now.Subtract(now)
AntsHelper.Tracker.SendToExternalLog("c:\loadtest\hyperthreading.txt", QueryName & vbTab & Result & vbTab & ElapsedTime.ToString())
End Try

Alternately, one could write an assembly, reference it, and use that. I haven't found anything that I can't do with ANTS load so far...some things are really difficult and some things are really slow, but I've been able to do them.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group