0
好吧,我想獲得的結果出來這個命令應該返回的東西謊言 (X)行受到影響 命令成功完成 print語句這裏多個查詢
我不知道如何獲得在richtextbox..so的結果,如果有任何人能幫助我,這將是冷靜
sqlconn.cnn = new SqlConnection("Data Source=.\\SQLEXPRESS" + ";Initial Catalog=" + shard.Text + ";User ID=" + textBox3.Text + ";Password=" + textBox4.Text);
sqlconn.cnn.Open();
SqlCommand cmd = new SqlCommand("DELETE FROM _SiegeFortress Where FortressID LIKE'%[1,3,6]%' INSERT INTO _SiegeFortress (FortressID,GuildID,TaxRatio,Tax,NPCHired,TempGuildID,Introduction,CreatedDungeonTime,CreatedDungeonCount,IntroductionModificationPermission) VALUES (1 ,0 ,0 ,0 ,0 ,0 ,NULL ,NULL ,0 ,1) INSERT INTO _SiegeFortress (FortressID,GuildID,TaxRatio,Tax,NPCHired,TempGuildID,Introduction,CreatedDungeonTime,CreatedDungeonCount,IntroductionModificationPermission) VALUES (3 ,0 ,0 ,0 ,0 ,0 ,NULL ,NULL ,0 ,1) INSERT INTO _SiegeFortress (FortressID,GuildID,TaxRatio,Tax,NPCHired,TempGuildID,Introduction,CreatedDungeonTime,CreatedDungeonCount,IntroductionModificationPermission) VALUES (6 ,0 ,0 ,0 ,0 ,0 ,NULL ,NULL ,0 ,1) PRINT 'fewfwef'", sqlconn.cnn);
cmd.Connection = sqlconn.cnn;
SqlDataReader crap;
try
{
crap = cmd.ExecuteReader();
crap.Close();
MessageBox.Show("Crap");
SqlDataReader name = cmd.ExecuteReader();
richTextBox1.Text = name.ToString();
name.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
有一個插入/ print語句 – ex0ff 2014-09-03 10:38:33
,當我使用的ExecuteNonQuery它返回一個int – ex0ff 2014-09-03 10:42:36
@KhaledMohamed什麼是'print'說法? o.O是的'ExecuteNonQuery'返回'int',你可以象我一樣將它轉換爲'string'。 – 2014-09-03 10:44:00