views:

41

answers:

1

I have a page 3 datacontrols (in order, datalist->grid->listview, the selection from one feeds into the next) works perfectly locally, using dot net connector for mysql. My webhost uses ODBC, and I had to remove [ ] from the select statements in my code and put the table names. I removed the [ ] 's and my page runs, and my 1st/datalist control shows but now my "selected value" of my datalist, doesn't populate my grid control.

I imagine theres another peculiarity with the way odbc handles parameters.

Here is my original, for my grid:

<asp:SqlDataSource ID="recipegrid" runat="server"
            ConnectionString="<%$ ConnectionStrings:exoticingConnectionString %>"
            ProviderName="<%$ ConnectionStrings:exoticingConnectionString.ProviderName %>"
            SelectCommand="SELECT [Id], [Name], [Cal], [Pro], [Fat], [Carb], [Fiber], [Chol], [Sod] FROM [tblrecipes] WHERE ([filenameid] = @filenameid) ORDER BY [name]">
            <SelectParameters>
                <asp:ControlParameter ControlID="DataList1" Name="filenameid"
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>   

example of changes to select that allowed my page to run again:

SelectCommand="SELECT tblrecipes.Id, tblrecipes.Name, tblrecipes.Cal, tblrecipes.Pro, tblrecipes.Fat, tblrecipes.Carb, tblrecipes.Fiber, tblrecipes.Chol, tblrecipes.Sod FROM tblrecipes WHERE tblrecipes.filenameid = @filenameid ORDER BY tblrecipes.name">

BTW,

I also tried removing my scriptmanager & updatepanel,, and using autopostbacks instead in my controls, jik, and nothing changed so I put it back.

A: 

changed : WHERE ([filenameid] = @filenameid)

to: WHERE ([filenameid] = ?)

and it worked

Mike