private void ViewAnyMovies() { var db = new moviegestDBEntities1(); //this.grdDB.DataSource = db.movie_dataset_fixed.SqlQuery("Select * from movie_dataset_fixed where title like (" + this.txtSearch.Text + ")"); //this.grdDB.DataSource = db.movie_dataset_fixed.Where(p => p.title.Equals(this.txtSearch.Text)).ToList(); //string sqlSELECT = "SELECT * FROM movie_dataset_fixed where title like ("+this.txtSearch.Text+")"; if (this.txtSearch.Text.Equals("")) { return; } else { command = connection.CreateCommand(); command.CommandText = "SELECT * FROM movie_dataset_fixed where title like ('%" + this.txtSearch.Text + "%')"; adapter.SelectCommand = command; //command.ExecuteNonQuery(); //table.Clear(); adapter.Fill(table); grdDB.DataSource = table; } }
void UpdateMovieForm_Load(object sender, EventArgs e) { //this.txtId.Text = movieId.ToString(); //this.txtBudget.Text = this.Business.movie; var db = new moviegestDBEntities1(); //this.grdDB.DataSource = db.movie_dataset_fixed.SqlQuery("Select * from movie_dataset_fixed where title like (" + this.txtSearch.Text + ")"); //this.grdDB.DataSource = db.movie_dataset_fixed.Where(p => p.title.Equals(this.txtSearch.Text)).ToList(); //string sqlSELECT = "SELECT * FROM movie_dataset_fixed where title like ("+this.txtSearch.Text+")"; if (this.txtId.Text.Equals("")) { return; } else { command = connection.CreateCommand(); command.CommandText = "UPDATE movie_dataset_fixed SET where id like ('%" + this.txtId.Text + "%')"; adapter.SelectCommand = command; } //b this.txtBudget = //throw new NotImplementedException(); }