Can We Insert New Reocrd By Using Ants Load

jagadeesh_qcjagadeesh_qc Posts: 2
edited January 3, 2007 4:34PM in ANTS Load
Hi All,

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


Thank You,
Jagadeesh

Comments

  • 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.
  • 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(), " ")
    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.
Sign In or Register to comment.