C#初心者です。ウェブサイトを作成しようとしています
削除オプションを指定するのに問題があります。エラー表示はありません。しかし、レコードは削除されていません
助けてください
protected void delete_button_Click(オブジェクト送信者, EventArgs e) {
string uname;
string pwd;
uname = txt_user.Text;
pwd = txt_pass.Text;
string connetionString = null;
OleDbConnection connection;
OleDbDataAdapter oledbAdapter = new OleDbDataAdapter();
string sql = null;
connetionString = "Provider=SQLOLEDB;dsn=xe;User id=sa;password=password123";
connection = new OleDbConnection(connetionString);
sql = "DELETE * FROM Login WHERE username='" + uname + "' and password='" +pwd+ "'";
try
{
connection.Open();
oledbAdapter.DeleteCommand = connection.CreateCommand();
oledbAdapter.DeleteCommand.CommandText = sql;
oledbAdapter.DeleteCommand.ExecuteNonQuery();
Label4.Text = "deleted";
}
ありがとうございました