[Solved] Entering value to database after pressing enter from a textbox [closed]

Use for this KeyDown event private void YourTextBox_KeyDown(object sender, KeyEventArgs e) { String connection= “Data Source=YourServer;Initial Catalog=YourDatabase;user=User;password=YourPassword;Integrated Security=True;”; if (e.KeyCode == Keys.Enter) { string insertCmdText = “INSERT INTO table(column1)values(@valueForColumn1)”; SqlCommand sqlCom = new SqlCommand(insertCmdText,connection); sqlCom.Paramaters.AddWithValue(“@valueForColumn1”,YourTextBox.Text); connection.Open(); sqlCom.ExecuteNonQuery(); connection.Close(); } } But consider that saving into Database after KeyPress event is not a right way to … Read more

[Solved] Pass Variable To Another file [closed]

The 2 files should be on the same location and php is installed in your server A.html … <a href=”https://stackoverflow.com/questions/54946766/B.php?data1=1654&data2=string”>Button</a> … B.php <?php echo $_GET[‘data1’]; // output “1654” echo $_GET[‘data2’]; // output “string” solved Pass Variable To Another file [closed]

[Solved] How to save form data in database when submit button is clicked? [closed]

EditText fd1 = (EditText)findviewById(R.id.fd1); EditText fd2 = (EditText)findviewById(R.id.fd2); EditText fd3 = (EditText)findviewById(R.id.fd3); submitbtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { String field1 = fd1.getText.toString(); String field2 = fd2.getText.toString(); String field3 = fd3.getText.toString(); dh.insert_values(field1, field2, field3); } }); On submit insert values into the database as like this.. and in your datahelper class public long insert_values(String … Read more