ここでは、データベース STUD_DB から 3 つの列、studentlastname、studentfirstname、studentmiddleinitial を選択することを目指しているので、コードは次のとおりです。
public string selectname(string email)
{
string name;
SqlConnection con = new SqlConnection(constr);
string select = "SELECT studentlastname,studentfirstname,studentmiddleinitial FROM STUD_DB WHERE emailaddress = @mail";
SqlCommand sel = new SqlCommand(select, con);
sel.Parameters.Add("@mail", email);
//this is where idk what to do.
}
私の懸念は、3 つの列を選択した後、それらを別々の変数に配置し、それらを 1 つの文字列に結合して学生のフルネームにしたいのですが、その部分をコーディングする方法がわかりません。:) 回答をお待ちしております。:)