private void userInfoBtn_Click(object sender, EventArgs e) { dto.User user = R.Db(this.dbName).Table(this.tableName).Get(userInfoTextBox.Text).Run <dto.User>(this.connection.getConnection()); if (user != null) { MessageBox.Show("Name:" + user.Name + "\nSurname:" + user.Surname + "\nAge:" + user.Age); } }
private void insertButton_Click(object sender, EventArgs e) { try { var objData = new dto.User { Name = nameTextBox.Text, Surname = surnameTextBox.Text, Age = Int32.Parse(ageTextBox.Text) }; R.Db(this.dbName).Table(this.tableName).Insert(objData).Run(this.connection.getConnection()); }catch (FormatException) { MessageBox.Show("Format Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }