双11上云狂欢,0.5折起爆品开抢
Logo

博客

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["swosConnectionString"].ToString());
SqlCommand cmd = new SqlCommand("", con);
cmd.CommandText = "SELECT [ID], [tag] FROM [XsdnTag] where [abc]=@abc order by [order] desc";
//cmd.Parameters.AddWithValue("@ID", id);
//cmd.Parameters.Add("@abc", SqlDbType.NVarChar);
//cmd.Parameters["@abc"].Value = "sssss";
SqlParameter pText=new SqlParameter("@Text",mytext);
cmd.Parameters.Add(pText);
try
{
    con.Open();
    cmd.ExecuteNonQuery();
    //SqlDataReader dr = cmd.ExecuteReader();
    //while (dr.Read())
    //{
    //    ddddd = dr["ID"].ToString();
    //}
    //dr.Close();
}
catch (Exception ex)
{
    zErrorLog.catchError(Request.Url.ToString(), ex.Message);
}
finally
{
    con.Close();
}

2,570 阅读