Can We Insert New Reocrd By Using Ants Load

Forum for users of ANTS web server load testing tool

Moderator: Brian Donahue

Can We Insert New Reocrd By Using Ants Load

Postby jagadeesh_qc » Fri Sep 01, 2006 10:55 am

Hi All,

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


Thank You,
Jagadeesh
jagadeesh_qc
 
Posts: 1
Joined: Fri Sep 01, 2006 10:41 am

Postby Brian Donahue » Mon Sep 11, 2006 6:43 pm

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.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

I've accomplished this task very easily

Postby tommyjjohnson » Wed Jan 03, 2007 10:34 pm

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.
tommyjjohnson
 
Posts: 3
Joined: Wed Jan 03, 2007 10:21 pm


Return to ANTS Load

Who is online

Users browsing this forum: No registered users and 0 guests