本文整理汇总了C#中MySql.Data.MySqlClient.MySqlConnection.NewCommandEx方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlConnection.NewCommandEx方法的具体用法?C# MySqlConnection.NewCommandEx怎么用?C# MySqlConnection.NewCommandEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlConnection
的用法示例。
在下文中一共展示了MySqlConnection.NewCommandEx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
/*
WebClient webClient = new WebClient();
webClient.DownloadFile("http://api.netflix.com/catalog/titles/full?v=2.0?oauth_consumer_key=vwhxtj7gjyze6mvddb28znjd&oauth_nonce=FlucT&oauth_signature=lujB0gjGYHdm2DCDQQ%2FYxCzjvR8%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1328651121&oauth_version=1.0&output=xml", @"c:\netflix2.xml");
*/
var conn = new MySqlConnectionInfo("localhost", "root", "Password01", "Netflix");
// int countdown = 250;
using (_sql = new MySqlConnection(conn.ConnectionString))
{
_sql.Open();
MySqlTransaction transaction = _sql.BeginTransaction();
_sql.NewCommandEx("DELETE FROM Title" ).ExecuteNonQuery();
_sql.NewCommandEx("DELETE FROM Category" ).ExecuteNonQuery();
_sql.NewCommandEx("DELETE FROM Link" ).ExecuteNonQuery();
_sql.NewCommandEx("DELETE FROM External" ).ExecuteNonQuery();
_sql.NewCommandEx("DELETE FROM Availability").ExecuteNonQuery();
var textReader = new XmlTextReader("C:\\netflix.xml");
// Read until end of file
while (textReader.Read())
{
XmlNodeType nType = textReader.NodeType;
// if node type is an element
if (nType == XmlNodeType.Element)
{
if (textReader.Name == "title_index_item")
{
ParseTitleIndexItem(textReader);
//countdown--;
//if (countdown == 0)
// break;
}
}
}
transaction.Commit();
}
return;
}