我必须使用“@”(我不知道它的名字)。我可以在更新删除或插入语句中使用它,但我不能在其中使用它它给出的 URL 必须声明
//SQL string to count the amount of rows within the OSDE_Users table
string sql = "SELECT * FROM RSSFeeds where URL = @URL";
SqlCommand cmd = new SqlCommand(sql, Connect());
cmd.Parameters.Add("@URL", SqlDbType.VarChar, 500).Value = url;
closeConnection();
SqlDataAdapter adapt = new SqlDataAdapter(sql, Connect());
DataSet ds = new DataSet();
adapt.Fill(ds);
// result of query filled into datasource
adapt.Dispose();
closeConnection();
return ds;