Hi VAer-4038,
For question1, you can try the following the code:
using (OdbcConnection connection = new OdbcConnection())
{
connection.ConnectionString = "Your connectionString";
connection.Open();
OdbcCommand command = new OdbcCommand("SELECT * from TableUser WHERE Username = '" + ENvironment.Name + "'", connection );
// Execute the DataReader and access the data.
OdbcDataReader dr = command.ExecuteReader();
while (dr.Read())
{
TextboxFirstName.Text = dr["FirstName"].ToString();
TextboxLastName.Text = dr["LastName "].ToString();
}
}
For question2, you can use OdbcCommand.ExecuteNonQuery method to execute an SQL statement against the connection.
And here is code example i this document you can refer to.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.