Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd event by clicking button design of axml in monodroid?
    primarykey
    data
    text
    <p>Is it possible to add button click event by clicking design of axml? if yes then how? if no how can i add by other way? i am trying to make my first application using visual studio 2010.</p> <p>code sample</p> <pre><code>public class Activity1 : Activity { string dbPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "tdsl_validation.sqlite"); private Button login_button; private EditText user; private EditText passs; protected override void OnCreate(Bundle bundle) { var ss=dbPath; base.OnCreate(bundle); user = (EditText)FindViewById(Resource.Id.editText1); passs = (EditText)FindViewById(Resource.Id.editText3); login_button = (Button)FindViewById(Resource.Id.button1); login_button.Click += new EventHandler(button1_Click); SetContentView(Resource.Layout.Main); } private bool validate_user(string username, string password) { bool i; i = true; string str; DataTable dt = new DataTable(); string dbPath1 = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "tdsl_validation.sqlite"); SqliteConnection con = new SqliteConnection("Data Source="+ dbPath1); str = "select pass from user_detail where user_name='" + username + "' and pass='" + password + "'"; SqliteCommand cmd = new SqliteCommand(str, con); SqliteDataAdapter da = new SqliteDataAdapter(cmd); da.Fill(dt); if (dt != null) { if (dt.Rows.Count &gt; 0) { i = true; } else { i = false; } } else { i = false; } return i; } void button1_Click(object sender, EventArgs e) { bool i; user = (EditText)FindViewById(Resource.Id.editText1); passs = (EditText)FindViewById(Resource.Id.editText3); i = validate_user(user.Text, passs.Text); i = validate_user(user.Text, passs.Text); if (i == true) { } else { Toast.MakeText(this, "Invalid Username or Password", ToastLength.Short).Show(); } // stuff here } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload