I have here my code for a SQL Query in C#.
string user_select()
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\avasi\Desktop\PROIECTE_USV\FoodKing_PC\FoodKing_PC\SQL_Database\fkDatabase.mdf;Integrated Security=True;Connect Timeout=30");
SqlDataAdapter sda = new SqlDataAdapter("SELECT * FROM tabel_utilizatori WHERE user_name ='" + this.user_name + "' AND user_password ='" + this.user_password + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
}
Can you help me to move the data from that SQLDataAdapter to the data members of this class?
class utilizator
{
int user_id;
string user_name;
string user_password;
string user_email;
string user_phone;
string user_avatar;
bool user_firstlogin;
int user_type;
}