what's the difference between these querys? : Following [how to select specific feid using a filter from access in C#][1]


  [1]: http://stackoverflow.com/questions/36422084/how-to-select-specific-feid-using-a-filter-from-access-in-c-sharp

I have another question:

I recall this method whit a click event of `SelectFeedbtn_Click` and it works:

    public static void GetSelectedFeed(Form2 frm2)
        {
            string StrCon = System.Configuration.ConfigurationManager.ConnectionStrings["FeedLibraryConnectionString"].ConnectionString;
            OleDbConnection Connection = new OleDbConnection(StrCon);
            OleDbDataAdapter DataA = new OleDbDataAdapter("Select * from FeedLibrary", Connection);
            DataTable DTable = new DataTable();
            DataA.Fill(DTable);
            frm2.SelectedFeeddataGridView.DataSource = DTable;
        }

even this query is working:

    public static void GetSelectedFeed(Form2 frm2)
        {
            string StrCon = System.Configuration.ConfigurationManager.ConnectionStrings["FeedLibraryConnectionString"].ConnectionString;
            OleDbConnection Connection = new OleDbConnection(StrCon);
            OleDbDataAdapter DataA = new OleDbDataAdapter("Select * from FeedLibrary where Category = 'Plant Protein'", Connection);
            DataTable DTable = new DataTable();
            DataA.Fill(DTable);
            frm2.SelectedFeeddataGridView.DataSource = DTable;
        }

but when I want to get an ID from `FeedSelectListBox` that`DisplayMember` is Feed Name / Description and `ValueMember` is ID it doesn't work, the query is:

    public static void GetSelectedFeed(Form2 frm2)
        {
            string StrCon = System.Configuration.ConfigurationManager.ConnectionStrings["FeedLibraryConnectionString"].ConnectionString;
            OleDbConnection Connection = new OleDbConnection(StrCon);
            OleDbDataAdapter DataA = new OleDbDataAdapter("Select * from FeedLibrary where ID = 'frm2.FeedSelectListBox.SelectedValue'", Connection);
            DataTable DTable = new DataTable();
            DataA.Fill(DTable);
            frm2.SelectedFeeddataGridView.DataSource = DTable;
        }
I get ID with a variable like this but still doesn't work:

    public static void GetSelectedFeed(Form2 frm2)
        {
            string StrCon = System.Configuration.ConfigurationManager.ConnectionStrings["FeedLibraryConnectionString"].ConnectionString;
            OleDbConnection Connection = new OleDbConnection(StrCon);
            string FeedSelectedID = frm2.FeedSelectListBox.SelectedValue.ToString();
            OleDbDataAdapter DataA = new OleDbDataAdapter("Select * from FeedLibrary where ID = 'FeedSelectedID'", Connection);
            DataTable DTable = new DataTable();
            DataA.Fill(DTable);
            frm2.SelectedFeeddataGridView.DataSource = DTable;
        }

I even inter Id manually and still doesn't work:

    public static void GetSelectedFeed(Form2 frm2)
        {
            string StrCon = System.Configuration.ConfigurationManager.ConnectionStrings["FeedLibraryConnectionString"].ConnectionString;
            OleDbConnection Connection = new OleDbConnection(StrCon);
            OleDbDataAdapter DataA = new OleDbDataAdapter("Select * from FeedLibrary where ID = '2'", Connection);
            DataTable DTable = new DataTable();
            DataA.Fill(DTable);
            frm2.SelectedFeeddataGridView.DataSource = DTable;
        }

what should I do ???

 