I have been struggling with this for a while trying to format the strselect string properly to execute the select command on an access database using a asp.net web application. I can't get it formatted the right way to bind the datagrid. Here is what I started with:
condb = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\Inetpub\ strSelect1 = "SELECT MovieId, MovieTitle, MovieCover, MovieIMDB, MovieDate, MovieGenre, MovieRuntime, MovieRating FROM GeneralInfo WHERE (((GeneralInfo.MovieTitle) Like '*' & [the] & '*'));"
cmdSelect1 = New OleDbCommand(strSelect1, condb)
cmdSelect1.Parameters.Add("the", TxtTitle.Text)
condb.Open()
DGMovies.DataSource = cmdSelect1.ExecuteReader()
DGMovies.DataBind()
condb.Close()
condb = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\Inetpub\ strSelect1 = "SELECT MovieId, MovieTitle, MovieCover, MovieIMDB, MovieDate, MovieGenre, MovieRuntime, MovieRating FROM GeneralInfo WHERE (((GeneralInfo.MovieTitle) Like '*' & [the] & '*'));"
cmdSelect1 = New OleDbCommand(strSelect1, condb)
cmdSelect1.Parameters.Add("the", TxtTitle.Text)
condb.Open()
DGMovies.DataSource = cmdSelect1.ExecuteReader()
DGMovies.DataBind()
condb.Close()