public string GetAA()
{
using (SqlConnection connection = new SqlConnection(数据库连接字符串))
{
if (oleCon.State != ConnectionState.Open)
{
oleCon.Open();
}
string sql = string.Format("Select aa from [announcement] where (aa= '{0}')", "sss");
SqlCommand cmd = new SqlCommand(sql,connection);
rObj = cmd.ExecuteScalar();
cmd.Parameters.Clear();
return rObj;
}
}
string qq = GetAA();
string qq;
sqlstr = "Select aa from [announcement] where (aa= @sss) ";
con = new SqlConnection(constr);
con.Open();
SqlCommand cmd = new SqlCommand(sqlstr, con);
cmd.Parameters.AddWithValue("@sss", sss);
SqlDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
qq = reader[0].ToString();
}
var ds =( from s in _DB.T001用户表
where s.ID_T001用户表 == int.Parse(login.LoginValue)
select s).FirstOrDefault();
if(ds !=null)
{
this.label1.Text = ds.昵称;
}
string
qq;
sqlstr
=
"Select
aa
from
[announcement]
where
(aa=
@sss)
";
con
=
new
SqlConnection(constr);
con.Open();
SqlCommand
cmd
=
new
SqlCommand(sqlstr,
con);
cmd.Parameters.AddWithValue("@sss",
sss);
SqlDataReader
reader
=
cmd.ExecuteReader();
if
(reader.Read())
{
qq
=
reader[0].ToString();
}