这是我的代码的一部分:
x8 = int.Parse( txtt10x100t.Text);
if (x8 > 0)
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=database;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "INSERT INTO tbltable " + "(id, name, value , date, iid) " + "VALUES(@id, @name, @value, @date, @iid )";
cmd.Parameters.AddWithValue("@id", v2);
cmd.Parameters.AddWithValue("@name", "10*100");
cmd.Parameters.AddWithValue("@value", x8);
cmd.Parameters.AddWithValue("@date", tarikh);
cmd.Parameters.AddWithValue("@iid", xxiid);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
x9 = int.Parse(txtt10x150t.Text);
if (x9 > 0)
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=dbdatabase;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "INSERT INTO tbltable " + "(id, name, value, date, iid) " + "VALUES(@id, @name, @value, @date, @iid )";
cmd.Parameters.AddWithValue("@id", v2);
cmd.Parameters.AddWithValue("@name", "10*150");
cmd.Parameters.AddWithValue("@value", x9);
cmd.Parameters.AddWithValue("@date", tarikh);
cmd.Parameters.AddWithValue("@iid", xxiid);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
x10 = int.Parse(txtt15x100t.Text);
if (x10 > 0)
{
SqlConnection cn = new SqlConnection("Data Source=.;Initial Catalog=dbdatabase;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = "INSERT INTO tbltable " + "(id, name, value, date, iid) " + "VALUES(@id, @name, @value, @date, @iid )";
cmd.Parameters.AddWithValue("@id", v2);
cmd.Parameters.AddWithValue("@name", "15*100");
cmd.Parameters.AddWithValue("@value", x10);
cmd.Parameters.AddWithValue("@date", tarikh);
cmd.Parameters.AddWithValue("@iid", xxiid);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
// , ete ....
我已将其设为override func viewDidLoad() {
super.viewDidLoad()
userName.text = username!
let current_status = Status!
if current_status == "Online"
{
Suggestion.text = "He is Online! You can talk with him directly or add him!"
}
else
{
Suggestion.text = "He is busy! You'd better talk with him later!"
}
}
,但当Xcode运行时,其内容仍无法以多行显示。
我该怎么办?