W
William LaMartin
On webform, I am populating a GridView from a SQLDatasource based on a MySQL
table named PIB.
There is no vb code involved. Everything is done in the source for the aspx
page, provided below. The update works fine, but a delete of a row produces
the following error:
Exception Details: System.Data.Odbc.OdbcException: ERROR [07001]
[MySQL][ODBC 3.51 Driver][mysqld-5.0.27]SQLBindParameter not used for all
parameters
The table, PIB, involved has a primary key , Id, and I have worked on this
for some time with no solution. Does anyone know the answer?
Thanks
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txtUid" runat="server" Style="z-index: 100; left: 14px;
position: absolute; top: 96px">JoeTestor</asp:TextBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:MysoftwareConnectionString %>"
ProviderName="<%$ ConnectionStrings:MysoftwareConnectionString.ProviderName
%>"
SelectCommand="Select * from PIB where Uid=?"
UpdateCommand="UPDATE PIB SET Description = ?, Lat = ?, Link = ?, Lon = ?,
Map = ?, Title = ?, Uid = ? WHERE Id = ?"
DeleteCommand ="DELETE FROM PIB WHERE Id=?">
<SelectParameters>
<asp:ControlParameter ControlID="txtUid" Name="?" PropertyName="Text" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="Description" Type="String"/>
<asparameter Name="Lat" Type="String" />
<asparameter Name="Link" Type="String" />
<asparameter Name="Lon" Type="String" />
<asparameter Name="Map" Type="String" />
<asparameter Name="Title" Type="String" />
<asparameter Name="Uid" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="Id" Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True" DataSourceID="SqlDataSource1" Style="z-index:
102;
left: 5px; position: absolute; top: 149px">
</asp:GridView>
</form>
</body>
table named PIB.
There is no vb code involved. Everything is done in the source for the aspx
page, provided below. The update works fine, but a delete of a row produces
the following error:
Exception Details: System.Data.Odbc.OdbcException: ERROR [07001]
[MySQL][ODBC 3.51 Driver][mysqld-5.0.27]SQLBindParameter not used for all
parameters
The table, PIB, involved has a primary key , Id, and I have worked on this
for some time with no solution. Does anyone know the answer?
Thanks
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txtUid" runat="server" Style="z-index: 100; left: 14px;
position: absolute; top: 96px">JoeTestor</asp:TextBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:MysoftwareConnectionString %>"
ProviderName="<%$ ConnectionStrings:MysoftwareConnectionString.ProviderName
%>"
SelectCommand="Select * from PIB where Uid=?"
UpdateCommand="UPDATE PIB SET Description = ?, Lat = ?, Link = ?, Lon = ?,
Map = ?, Title = ?, Uid = ? WHERE Id = ?"
DeleteCommand ="DELETE FROM PIB WHERE Id=?">
<SelectParameters>
<asp:ControlParameter ControlID="txtUid" Name="?" PropertyName="Text" />
</SelectParameters>
<UpdateParameters>
<asparameter Name="Description" Type="String"/>
<asparameter Name="Lat" Type="String" />
<asparameter Name="Link" Type="String" />
<asparameter Name="Lon" Type="String" />
<asparameter Name="Map" Type="String" />
<asparameter Name="Title" Type="String" />
<asparameter Name="Uid" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="Id" Type="Int32"/>
</DeleteParameters>
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True" DataSourceID="SqlDataSource1" Style="z-index:
102;
left: 5px; position: absolute; top: 149px">
</asp:GridView>
</form>
</body>