CreateCommand Method (MailChimpConnection)
Creates and returns a
MailChimpCommand object associated with the
MailChimpConnection.
In this sample
MailChimpCommand object is created. It is automatically associated with
MailChimpConnection that created it.
public void CreateMailChimpCommand(string myConnString)
{
MailChimpConnection mailchimpConnection = new MailChimpConnection(myConnString);
MailChimpCommand mailchimpCommand = mailchimpConnection.CreateCommand();
mailchimpCommand.CommandText = "INSERT INTO Folders(Name, Type) VALUES ('Sales', 'campaign')";
mailchimpConnection.Open();
try
{
mailchimpCommand.ExecuteNonQuery();
}
finally
{
mailchimpConnection.Close();
}
}
Public Sub CreateMailChimpCommand(ByVal myConnString As String)
Dim mailchimpConnection As New MailChimpConnection(myConnString)
Dim mailchimpCommand As MailChimpCommand = mailchimpConnection.CreateCommand()
mailchimpCommand.CommandText = "INSERT INTO Folders(Name, Type) VALUES ('Sales', 'campaign')"
mailchimpConnection.Open()
Try
mailchimpCommand.ExecuteNonQuery()
Finally
mailchimpConnection.Close()
End Try
End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2