Share this page

# .NET Single Connection Example

    namespace Script
    {
        public partial class VuserClass
        {
            public int Action()
            {
                ActionSingle();
                return 0;
            }

            private int ActionSingle()
            {
                vts.connect("123.123.123.123", 8888, LoadRunner.ConnectionOptions.KeepAlive);

                int i1 = vts.column_size("Region");
                lr.log_message("Column size = " + i1.ToString());

                vts.create_column("NewColl");

                vts.ensure_index("CustomerID");

                vts.drop_index("CustomerID");

                int newCount = vts.increment("EmployeeID", 2, 1);
                lr.log_message("Increment = " + newCount.ToString());

                vts.query_column("Phone", 1);
                lr.log_message("Phone = " + lr.eval_string("{Phone}"));

                vts.query_row(2);
                lr.log_message("Address = " + lr.eval_string("{Address}"));

                vts.retrieve_message("ContactName");
                lr.log_message("ContactName = " + lr.eval_string("{ContactName}"));

                vts.retrieve_messages("PostalCode;Country", ";");
                lr.log_message("PostalCode = " + lr.eval_string("{PostalCode}"));
                lr.log_message("Country = " + lr.eval_string("{Country}"));

                vts.retrieve_row();
                lr.log_message("ContactTitle = " + lr.eval_string("{ContactTitle}"));
                lr.log_message("CompanyName = " + lr.eval_string("{CompanyName}"));
                vts.clear_column("City");

                vts.clear_message("Address", 1);

                vts.clear_row(5);

                vts.send_if_unique("ContactTitle", "Mess1");

                vts.send_message("ContactTitle", "Mess2");

                vts.send_row("PostalCode;Country", "65098;Ukraine", ";", LoadRunner.SendRow.SameRow);

                vts.send_row("PostalCode;Country", "65098;Ukraine", ";", LoadRunner.SendRow.Stacked);

                vts.send_row("PostalCode;Country", "65098;Ukraine", ";", LoadRunner.SendRow.StackedUnique);

                vts.update_message("CustomerID", 7, "BLONP_CHANGED");

                vts.update_message_ifequals("CustomerID", 8, "BOLID_CHANGED", "BOLID");

                vts.update_row("Phone;Fax", 6, "Info;FooBar", ";");

                vts.disconnect();

                return 0;
            }
        }
    }

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: