Documente Academic
Documente Profesional
Documente Cultură
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace moviee
{
public partial class Form1 : Form
{
SqlConnection con = new SqlConnection("Data Source = DESKTOP-62A8AL7;
Initial Catalog = Moviee; User Id= kebede; Password =123456");
SqlDataAdapter sda;
SqlCommand cmd;
DataTable dt;
public Form1()
{
InitializeComponent();
}
}
private void btnUpdate_Click(object sender, EventArgs e)
{
con.Open();
string query = "Update Movie_Record Set Genre = '" + comboBoxGenre.Text
+ "', Release_Date = '" + dateTimePickerleaseDate.Text + "' Where Name = '" +
txtMovieName.Text + "'";
cmd = new SqlCommand(query , con);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("You have Updated successfully ");
con.Close();
}
}
}