I don't get your mean
I have a field in database and I want to don't let admin add duplicate keyword to it nevermind by which way.
I wrote this code but no success
public string searchkeywords()
{
string stringintable = "flower,tree,leaf";
string newstring = "greentree,tree,browntree";
string[] myarray = newstring.Split(',');
string[] ddddd = stringintable.Split(',');
string mylaststring = "";
for (int i = 0; i < myarray.Length; i++)
{
string t = myarray[i];
var result = from n in ddddd
where n == t
select n;
if (result != null)
{
mylaststring += "," + result.ToString();
}
}
return mylaststring;
}
protected void Button5_Click(object sender, EventArgs e)
{
string ddd = searchkeywords();
Response.Write(ddd);
}
}
that is for test
in reality I will write somthing like this:
SqlDataReader dr = MyDALBase.ExecuteReader(System.Data.CommandType.StoredProcedure, "editkewords", new SqlParameter[]{
new SqlParameter("@CategoryId",CategoryId)
});
dr.Read();
string stringintable = dr["keywords"].tostring();
string newstring = textbox1.text