Tuesday, March 27, 2012
Error publishing databases with not-server's default collation
While trying to publish any database that uses a collation different from
server's default, I get this error in the step after selecting the articles
to be published:
Error 21423: You do not have sufficient privileges to view the publication
information. Your administrator may need to fix the PAL role on the publisher
for publication 'database_name'.
I've being trying to track down this error for a while now, and I've just
noticed it's related to the collation...
Any ideas about this?
Not sure if it's relevant here, but when I had a case-sensitive server
collation I noticed that passwords of logins became case sensitive on
authentication. I wonder if there is somehow a login/user case sensitivity
issue at work here also? Are the 2 collations the same in this regard or
different (a mixture of _CS and _CI)? Please can you post up the entire
collation names for the circumstance that doesn't work.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||The collations are:
Chinese_Taiwan_Stroke_BIN for the dbs that fails
and:
SQL_Latin1_General_CP1_CI_AS for the dbs that are sucessfuly published.
In any case, the passwords for the accounts are all lowercase...
Thanks for your support,
RODOLFO
"Paul Ibison" wrote:
> Not sure if it's relevant here, but when I had a case-sensitive server
> collation I noticed that passwords of logins became case sensitive on
> authentication. I wonder if there is somehow a login/user case sensitivity
> issue at work here also? Are the 2 collations the same in this regard or
> different (a mixture of _CS and _CI)? Please can you post up the entire
> collation names for the circumstance that doesn't work.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
Wednesday, March 7, 2012
Error Message: Must declare variable @ID
I'm having trouble with a datalist. The default view is the Item Template which has an Edit button. When I click the Edit button, I run the following code (for the EditCommand of the Datalist):
DataList1.EditItemIndex = e.Item.ItemIndex
DataBind()
It errors out with the message "Must declare variable @.ID".
I've used this process on other pages without problem.
The primary key for the recordsource that populates this datalist is a field named "AutoID". There is another field named ID that ties these records to a master table. The list of rows returned in the datalist is based off the ID field matching a value in a dropdown list on the page (outside of the datalist). So my SQLdatasource has a parameter to match the ID field to @.ID. For some reason, it's not finding it and I cannot determine why. I haven't had this issue on other pages.
Here's my markup of the SQLDataSource and the Datalist/Edit Template:
<asp:SqlDataSourceID="SqlDataSource4"runat="server"ConnectionString="<%$ ConnectionStrings:SMARTConnectionString%>"
DeleteCommand="DELETE FROM [tblSalesSupport] WHERE [NBID] = @.NBID"
InsertCommand="INSERT INTO [tblSalesSupport] ([ID], [NBNC], [NBEC], [Description], [Estimate], [CompanyID], [CompanyName], [ProjectNumber]) VALUES (@.ID, @.NBNC, @.NBEC, @.Description, @.Estimate, @.CompanyID, @.CompanyName, @.ProjectNumber)"
SelectCommand="SELECT * FROM [tblSalesSupport] WHERE ([ID] = @.ID)"
UpdateCommand="UPDATE [tblSalesSupport] SET [ID] = @.ID, [NBNC] = @.NBNC, [NBEC] = @.NBEC, [Description] = @.Description, [Estimate] = @.Estimate, [CompanyID] = @.CompanyID, [CompanyName] = @.CompanyName, [ProjectNumber] = @.ProjectNumber WHERE [NBID] = @.NBID">
<DeleteParameters>
<asp:ParameterName="NBID"Type="Int32"/>
</DeleteParameters>
<UpdateParameters>
<asp:ParameterName="ID"Type="Int32"/>
<asp:ParameterName="NBNC"Type="Boolean"/>
<asp:ParameterName="NBEC"Type="Boolean"/>
<asp:ParameterName="Description"Type="String"/>
<asp:ParameterName="Estimate"Type="Decimal"/>
<asp:ParameterName="CompanyID"Type="Int32"/>
<asp:ParameterName="CompanyName"Type="String"/>
<asp:ParameterName="ProjectNumber"Type="String"/>
<asp:ParameterName="NBID"Type="Int32"/>
</UpdateParameters>
<SelectParameters>
<asp:ControlParameterControlID="ddlFind"Name="ID"PropertyName="SelectedValue"Type="Int32"/>
</SelectParameters>
<InsertParameters>
<asp:ParameterName="ID"Type="Int32"/>
<asp:ParameterName="NBNC"Type="Boolean"/>
<asp:ParameterName="NBEC"Type="Boolean"/>
<asp:ParameterName="Description"Type="String"/>
<asp:ParameterName="Estimate"Type="Decimal"/>
<asp:ParameterName="CompanyID"Type="Int32"/>
<asp:ParameterName="CompanyName"Type="String"/>
<asp:ParameterName="ProjectNumber"Type="String"/>
</InsertParameters>
</asp:SqlDataSource>
<asp:DataListCssClass="MainFormDisplay"ID="DataList1"runat="server"DataKeyField="NBID"DataSourceID="SqlDataSource1"width="100%">
<HeaderTemplate>….</HeaderTemplate>
<ItemTemplate>….</ItemTemplate>
<EditItemTemplate>
<tableborder="0" style="width: 100%">
<trclass="MainFormDisplay" valign="top">
<tdcolspan="8">
<asp:TextBoxID="txtNBID"runat="server"Text='<%# Eval("NBID")%>'Visible="true"></asp:TextBox>
<asp:TextBoxID="txtID"runat="server"Text='<%# Bind("ID")%>'Visible="True"></asp:TextBox></td>
</tr>
<trclass="MainFormDisplay">
<tdvalign="top"style="width: 100px"><asp:CheckboxID="chkNBNC"runat="server"Checked='<%# Bind("NBNC")%>'/></td>
<tdstyle="width: 100"><asp:CheckBoxID="chkNBEC"runat="server"Checked='<%# Bind("NBEC")%>'Width="100px"/></td>
<tdstyle="width: 100px"><asp:TextBoxID="txtCompanyName"runat="server"Text='<%# Bind("CompanyName")%>'Width="100px"></asp:TextBox></td>
<tdstyle="width: 100px"><asp:TextBoxID="txtProjectNumber"runat="server"Text='<%# Bind("ProjectNumber")%>'Width="100px"></asp:TextBox></td>
<tdstyle="width: 100px"><asp:TextBoxID="txtDescription"runat="server"Text='<%# Bind("Description")%>'Width="100px"></asp:TextBox></td>
<tdstyle="width: 100px"><asp:TextBoxID="txtEstimate"runat="server"Text='<%# Bind("Estimate","{0:N2}")%>'Width="100px"></asp:TextBox></td>
<tdstyle="width: 55px"><asp:CheckBoxID="ckDeleteFlag"runat="server"/></td>
<tdstyle="width: 100px"><asp:ButtonID="ItemSaveButton"runat="server"CommandName="Update"Text="Save"/>
<asp:ButtonID="ItemCancelButton"runat="server"CommandName="Cancel"Text="Cancel"/></td>
</tr>
</table>
</EditItemTemplate>
</asp:DataList><br/>
You need to replace
<asp:ParameterName="ID"Type="Int32"/>
in your UpdateParameters with
<asp:ControlParameterControlID="ddlFind"Name="ID"PropertyName="SelectedValue"Type="Int32"/>
|||Thank you very much for your reply. I have tried this though and I still get the same error.
I believe it's because it's not running the UpdateCommand at all at this point. When I click the Edit button, it simply flips it from ItemTemplate to EditTemplate, passing the index of the row that the user click on so that while in EditTemplate mode, the user can make changes to data, click save and update. The code that runs when the Edit button is clicked is the following: (This
Protected Sub DataList1_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.EditCommand
DataList1.EditItemIndex = e.Item.ItemIndex
DataBind()
End Sub