Monday, March 26, 2012
Problem with SQL Query file
I've installed the Project Server post SP1 Hotfix in my test lab and all
looks ok, apart from some errors when I execute the websps.sql query file
that forms part of the hotfix. The errors look like this.
There is no such user or group 'MSProjectServerRole'.
Here's an example of one of the entries in the query file that generates the
error.
/* Query #65005 */
CREATE PROCEDURE dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo
AS
select WADMIN_SMTP_SERVER_NAME,
WADMIN_SMTP_SERVER_PORT,
WADMIN_DEFAULT_LANGUAGE,
WADMIN_NTFY_FROM_EMAIL,
WADMIN_NTFY_EMAIL_TRAILER,
WADMIN_ORG_EMAIL_ADDRESS,
WADMIN_NPE_LAST_RUN,
WADMIN_NPE_NEXT_RUN,
WADMIN_NPE_SCHEDULED_TIME,
WADMIN_INTRANET_SERVER_URL,
WADMIN_EXTRANET_SERVER_URL,
WADMIN_EMAIL_CHARSET
from MSP_WEB_ADMIN
RETURN
GO
GRANT EXECUTE ON dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo TO
MSProjectServerRole
GO
********************************
I've checked that the MSProjectServerRole exists and is populated with
MSProjectServerUser, so all looks ok. I'm confused as to why the execution
of the stored procedure comes up with the error. The CREATE PROCEDURE part
doesn't appear to work as the stored procedure
MSP_WEB_SP_QRY_GetNotificationAdminInfo does not appear in Enterprise Manager
after the query file has finished executing.
Not being a SQL guy, can anyone give me a pointer as to how I can
troubleshoot this problem? I'm executing the query file as sa, so I don't
think this is a permissions thing.
Thanks
Tony
It appears that you created the proc in the wrong database. Likely, you put
it in master.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Tony Murray" <TonyMurray@.discussions.microsoft.com> wrote in message
news:1530354A-94BA-4F8C-B1E7-F31980B603A9@.microsoft.com...
I'm hoping you can help with something.
I've installed the Project Server post SP1 Hotfix in my test lab and all
looks ok, apart from some errors when I execute the websps.sql query file
that forms part of the hotfix. The errors look like this.
There is no such user or group 'MSProjectServerRole'.
Here's an example of one of the entries in the query file that generates the
error.
/* Query #65005 */
CREATE PROCEDURE dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo
AS
select WADMIN_SMTP_SERVER_NAME,
WADMIN_SMTP_SERVER_PORT,
WADMIN_DEFAULT_LANGUAGE,
WADMIN_NTFY_FROM_EMAIL,
WADMIN_NTFY_EMAIL_TRAILER,
WADMIN_ORG_EMAIL_ADDRESS,
WADMIN_NPE_LAST_RUN,
WADMIN_NPE_NEXT_RUN,
WADMIN_NPE_SCHEDULED_TIME,
WADMIN_INTRANET_SERVER_URL,
WADMIN_EXTRANET_SERVER_URL,
WADMIN_EMAIL_CHARSET
from MSP_WEB_ADMIN
RETURN
GO
GRANT EXECUTE ON dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo TO
MSProjectServerRole
GO
********************************
I've checked that the MSProjectServerRole exists and is populated with
MSProjectServerUser, so all looks ok. I'm confused as to why the execution
of the stored procedure comes up with the error. The CREATE PROCEDURE part
doesn't appear to work as the stored procedure
MSP_WEB_SP_QRY_GetNotificationAdminInfo does not appear in Enterprise
Manager
after the query file has finished executing.
Not being a SQL guy, can anyone give me a pointer as to how I can
troubleshoot this problem? I'm executing the query file as sa, so I don't
think this is a permissions thing.
Thanks
Tony
|||Thanks Tom, you were spot-on :-) I had highlighted the ProjectServer
database in the left hand pane of Query Analyzer, but had not specified it in
the drop down list in the right pane.
Tony
"Tom Moreau" wrote:
> It appears that you created the proc in the wrong database. Likely, you put
> it in master.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "Tony Murray" <TonyMurray@.discussions.microsoft.com> wrote in message
> news:1530354A-94BA-4F8C-B1E7-F31980B603A9@.microsoft.com...
> I'm hoping you can help with something.
> I've installed the Project Server post SP1 Hotfix in my test lab and all
> looks ok, apart from some errors when I execute the websps.sql query file
> that forms part of the hotfix. The errors look like this.
> There is no such user or group 'MSProjectServerRole'.
> Here's an example of one of the entries in the query file that generates the
> error.
> /* Query #65005 */
> CREATE PROCEDURE dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo
> AS
> select WADMIN_SMTP_SERVER_NAME,
> WADMIN_SMTP_SERVER_PORT,
> WADMIN_DEFAULT_LANGUAGE,
> WADMIN_NTFY_FROM_EMAIL,
> WADMIN_NTFY_EMAIL_TRAILER,
> WADMIN_ORG_EMAIL_ADDRESS,
> WADMIN_NPE_LAST_RUN,
> WADMIN_NPE_NEXT_RUN,
> WADMIN_NPE_SCHEDULED_TIME,
> WADMIN_INTRANET_SERVER_URL,
> WADMIN_EXTRANET_SERVER_URL,
> WADMIN_EMAIL_CHARSET
> from MSP_WEB_ADMIN
> RETURN
> GO
> GRANT EXECUTE ON dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo TO
> MSProjectServerRole
> GO
> ********************************
> I've checked that the MSProjectServerRole exists and is populated with
> MSProjectServerUser, so all looks ok. I'm confused as to why the execution
> of the stored procedure comes up with the error. The CREATE PROCEDURE part
> doesn't appear to work as the stored procedure
> MSP_WEB_SP_QRY_GetNotificationAdminInfo does not appear in Enterprise
> Manager
> after the query file has finished executing.
> Not being a SQL guy, can anyone give me a pointer as to how I can
> troubleshoot this problem? I'm executing the query file as sa, so I don't
> think this is a permissions thing.
> Thanks
> Tony
>
|||It's a common problem with DBA's. We usually belong to the sysadmin role
and have a default DB of master. If you include a USE statement, that can
fend off the wrong DB problem. Any object you create should also have the
appropriate GRANT statements, too. When you're in sysadmin, it always
works.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Tony Murray" <TonyMurray@.discussions.microsoft.com> wrote in message
news:209BE0C0-C948-4AE6-886E-F87A76AC3823@.microsoft.com...
Thanks Tom, you were spot-on :-) I had highlighted the ProjectServer
database in the left hand pane of Query Analyzer, but had not specified it
in
the drop down list in the right pane.
Tony
"Tom Moreau" wrote:
> It appears that you created the proc in the wrong database. Likely, you
> put
> it in master.
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "Tony Murray" <TonyMurray@.discussions.microsoft.com> wrote in message
> news:1530354A-94BA-4F8C-B1E7-F31980B603A9@.microsoft.com...
> I'm hoping you can help with something.
> I've installed the Project Server post SP1 Hotfix in my test lab and all
> looks ok, apart from some errors when I execute the websps.sql query file
> that forms part of the hotfix. The errors look like this.
> There is no such user or group 'MSProjectServerRole'.
> Here's an example of one of the entries in the query file that generates
> the
> error.
> /* Query #65005 */
> CREATE PROCEDURE dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo
> AS
> select WADMIN_SMTP_SERVER_NAME,
> WADMIN_SMTP_SERVER_PORT,
> WADMIN_DEFAULT_LANGUAGE,
> WADMIN_NTFY_FROM_EMAIL,
> WADMIN_NTFY_EMAIL_TRAILER,
> WADMIN_ORG_EMAIL_ADDRESS,
> WADMIN_NPE_LAST_RUN,
> WADMIN_NPE_NEXT_RUN,
> WADMIN_NPE_SCHEDULED_TIME,
> WADMIN_INTRANET_SERVER_URL,
> WADMIN_EXTRANET_SERVER_URL,
> WADMIN_EMAIL_CHARSET
> from MSP_WEB_ADMIN
> RETURN
> GO
> GRANT EXECUTE ON dbo.MSP_WEB_SP_QRY_GetNotificationAdminInfo TO
> MSProjectServerRole
> GO
> ********************************
> I've checked that the MSProjectServerRole exists and is populated with
> MSProjectServerUser, so all looks ok. I'm confused as to why the
> execution
> of the stored procedure comes up with the error. The CREATE PROCEDURE
> part
> doesn't appear to work as the stored procedure
> MSP_WEB_SP_QRY_GetNotificationAdminInfo does not appear in Enterprise
> Manager
> after the query file has finished executing.
> Not being a SQL guy, can anyone give me a pointer as to how I can
> troubleshoot this problem? I'm executing the query file as sa, so I don't
> think this is a permissions thing.
> Thanks
> Tony
>
Problem with SQL 2000 Reporting Services in Windows Server 2000 IIS 5.0
I′m having a problem with the SQL 2000 Reporting Services.
I′ve installed it in a windows 2000 server with IIS 5.0 and after i′ve installed the Reporting Services (even with the SP2 os Reporting Services installed), when i try to log on to the reports webside in order to start creating the folders of the reports that i want to create i get an error (ACCESS DENIED) and i′m trying to access it locally.
How can i solve this?
Regards,
Ricardo
Are you trying to open the website on the installed server or via another computer ?
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de
I′m trying to open the website on the instaled server. Even if i try to open it from a diferent computer, the error is the same.|||
Try using the rskeymgmt utility to backup the encryption key, and rsactivate utility to activate the site.
Check to see if the Default Application Pool in IIS is using the Network account identity.
Filemon from www.sysinternals.com may also help identify where the issue is.
cheers,
Andrew
|||Do you get an rsAccessDenied or the IIS Access Denied ?HTH, Jens SUessmeyer.http://www.sqlserver2005.de
problem with space
I've got one question. When I realize "log in" in my sql server, I am using
SP like this:
CREATE Procedure CustomerLogin
(
@.Email nvarchar(30),
@.Pwd nvarchar(10),
@.CustomerID int OUTPUT
)
AS
SELECT
@.CustomerID = CustomerID
FROM
Customers
WHERE
Email = @.Email COLLATE SQL_Latin1_General_CP1_CS_AS
AND
Pwd =@.Pwd COLLATE SQL_Latin1_General_CP1_CS_AS
IF @.@.Rowcount < 1
SELECT
@.CustomerID = 0
GO
The problem is that if the password is "qweqwe" and I try to log in with
"qweqwe " or even "qweqwe " (I mean with space after last symbol) it
succeed!!!
Interesting but if I try to log in with " qweqwe" (I mean with space in
beginning) it not succeed.
I don't know why. Could you please somebody help me?
Post the DDL for your Customers table. Specifically, what's datatype of
the Pwd column?
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Mango wrote:
>HI friends,
>I've got one question. When I realize "log in" in my sql server, I am using
>SP like this:
>CREATE Procedure CustomerLogin
>(
> @.Email nvarchar(30),
> @.Pwd nvarchar(10),
> @.CustomerID int OUTPUT
>)
>AS
>
>SELECT
> @.CustomerID = CustomerID
>
>FROM
> Customers
>
>WHERE
> Email = @.Email COLLATE SQL_Latin1_General_CP1_CS_AS
> AND
> Pwd =@.Pwd COLLATE SQL_Latin1_General_CP1_CS_AS
>
>IF @.@.Rowcount < 1
>SELECT
> @.CustomerID = 0
>GO
>
>The problem is that if the password is "qweqwe" and I try to log in with
>"qweqwe " or even "qweqwe " (I mean with space after last symbol) it
>succeed!!!
>Interesting but if I try to log in with " qweqwe" (I mean with space in
>beginning) it not succeed.
>I don't know why. Could you please somebody help me?
>
>
|||the datatype of Pwd is nvarchar. I found that is working corect if i write
it like this:
CREATE Procedure CustomerLogin
(
@.Email nvarchar(80),
@.Pwd nvarchar(50),
@.CustomerID int OUTPUT
)
AS
SELECT
@.CustomerID = CustomerID
FROM
Customers
WHERE
Email + '1' = @.Email COLLATE SQL_Latin1_General_CP1_CS_AS + '1'
AND
Pwd + '1'=@.Pwd COLLATE SQL_Latin1_General_CP1_CS_AS + '1'
IF @.@.Rowcount < 1
SELECT
@.CustomerID = 0
GO
But I am sure this is not the best approach
"Mike Hodgson" <mike.hodgson@.mallesons.nospam.com> wrote in message
news:#t9fdRIGFHA.2608@.TK2MSFTNGP10.phx.gbl...
> Post the DDL for your Customers table. Specifically, what's datatype of
> the Pwd column?
> --
> *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> *E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
http://www.mallesons.com[vbcol=seagreen]
>
> Mango wrote:
using[vbcol=seagreen]
it
>
Friday, March 23, 2012
problem with sp_addmergearticle
publication. But now it wants to rerun snapshot agent. Is there anyway where
i could add this table and create a snapshot only for that table only and not
the whole publication? Please tell me what would i have to do. I tried to use
@.force_invalidate_snapshot =0, but it says the snapshot was already run which
is true and i have to use 1 not 0.Thank you very much
exec sp_addmergearticle
@.publication = N'CDIMerge1',
@.article = N'DefReportExportOptions',
@.source_object = N'DefReportExportOptions',
@.type = N'table',
@.description = null,
@.column_tracking = N'true',
@.pre_creation_cmd = N'drop',
@.creation_script = null,
@.schema_option = 0x000000000000CFF1,
@.article_resolver = null,
@.source_owner = N'dbo',
@.subset_filterclause = null,
@.vertical_partition = N'false',
@.destination_owner = N'dbo',
@.auto_identity_range = N'false',
@.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true',
@.check_permissions = 0,
@.force_invalidate_snapshot =1
GO
Tejas,
merge is different in this way to transactional. The snapshot agent will
create a complete snapshot. However the merge agent will just initialize the
new article.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Tuesday, March 20, 2012
Problem with Searching unicode strings
I have problem with Contains command . I've made index on FName column of my
database which is nvarchar(100).
When I call contains command to search for english strings , it works very
well .But when I search for unicode strings ( I use farsi strings and insert
them in unicode ), sometimes it can not find them , in more than 70 percent
unicode searches , it works correctly , but sometimes it can't find very
simple strings, for example : it can't find " ^??? " strings . I use
these commands to find :
Select * from MyDB where Contains(FName, N' ^??? ' )
or
Select * from MyDB where Contains(FName, ' ^??? ' )
but no one can find the string.
please tell me what is wrong in command or what can I do to solve this
problem.
In addition , I want to send result of Select @.@.version command for you .
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows
NT 5.0 (Build 2195: Service Pack 4)
Thanks in Advance
Hamid.
what collation are you using? This works for me.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Hamid" <hamid@.omid.ca> wrote in message
news:OcaRgT9IFHA.904@.tk2msftngp13.phx.gbl...
> Hi,
> I have problem with Contains command . I've made index on FName column of
my
> database which is nvarchar(100).
> When I call contains command to search for english strings , it works very
> well .But when I search for unicode strings ( I use farsi strings and
insert
> them in unicode ), sometimes it can not find them , in more than 70
percent
> unicode searches , it works correctly , but sometimes it can't find very
> simple strings, for example : it can't find " ^??? " strings . I use
> these commands to find :
> Select * from MyDB where Contains(FName, N' ^??? ' )
> or
> Select * from MyDB where Contains(FName, ' ^??? ' )
> but no one can find the string.
> please tell me what is wrong in command or what can I do to solve this
> problem.
> In addition , I want to send result of Select @.@.version command for you
..
> Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
> Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on
Windows
> NT 5.0 (Build 2195: Service Pack 4)
> ----
> Thanks in Advance
> Hamid.
>
>
|||Hi,
These documents could not help me.
I've used SQL_Latin1_General_CP1_CI_AS collation in database. As I told, all
English strings will find by use of contains where-clause , My problem is
with Unicode stringe , which it can not find them . It find about 70 percent
of strings and it ignores some strings in search.
Please tell me how can I solve this problem.
Any Comments or suggestions appreciated.
Hamid.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:u2ZyToEJFHA.2356@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> what collation are you using? This works for me.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Hamid" <hamid@.omid.ca> wrote in message
> news:OcaRgT9IFHA.904@.tk2msftngp13.phx.gbl...
of[vbcol=seagreen]
> my
very[vbcol=seagreen]
> insert
> percent
you
> .
> Windows
> ----
>
Problem with Search Unicode Strings by use of <Contains>
I have problem with Contains command . I've made index on FName column of my
database which is nvarchar(100).
When I call contains command to search for english strings , it works very
well .But when I search for unicode strings ( I use farsi strings and insert
them in unicode ), sometimes it can not find them , in more than 70 percent
unicode searches , it works correctly , but sometimes it can't find very
simple strings, for example : it can't find " ^??? " strings . I use
these commands to find :
Select * from MyDB where Contains(FName, N' ^??? ' )
or
Select * from MyDB where Contains(FName, ' ^??? ' )
but no one can find the string.
please tell me what is wrong in command or what can I do to solve this
problem.
In addition , I want to send result of Select @.@.version command for you .
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows
NT 5.0 (Build 2195: Service Pack 4)
Also the Collation of Database and FName-field is :
SQL_Latin1_General_CP1_CI_AS
Thanks in Advance
Hamid.
Hamid,
First of all, thank you for providing the @.@.version (SQL Server 2000 SP3 on
Windows 2000 Server SP4) information along with the language (Farsi -
Iranian / Persian) and an example of your CONTAINS queries as this is most
helpful in helping you solve this problem!
Unfortunately, Farsi is not one of the subset of SQL Server 2000 supported
languages that Full Text Search supports, see SQL Server 2000 Books Online
title "Column-Level Linguistic Analysis", Note that it states that you
should "Use neutral when a column contains data in multiple languages or in
an unsupported language". Most likely, you have the FName column's "Language
for Word Breaker" set to US English. Could you confirm this with your reply
via sp_help_fulltext_columns ?
Assuming that you have your FT-enable column (FName) "Language for Word
Breaker" set to US English, you should drop the FT Catalog and re-create it
with the "Language for Word Breaker" set to Neutral and then run a Full
Population and re-test your CONTAINS query.
Additionally, you might want to checkout the new "Microsoft Arabic
Word-Breaker (Arabic Search Engine) - Beta" at
http://www.microsoft.com/middleeast/...v/beta/search/ and download the
Installation Guide and the Microsoft Arabic Word-Breaker. Now, I am not a
linguist, and I do not know how close or far apart Farsi or Persian is from
Arabic, but I'd suggest that you test it and let this newsgroup know if you
find it effective in resolving your FTS issues with Farsi strings.
Hope that helps!
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Hamid" <hamid@.omid.ca> wrote in message
news:e5Z4#hsJFHA.3928@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I have problem with Contains command . I've made index on FName column of
my
> database which is nvarchar(100).
> When I call contains command to search for english strings , it works very
> well .But when I search for unicode strings ( I use farsi strings and
insert
> them in unicode ), sometimes it can not find them , in more than 70
percent
> unicode searches , it works correctly , but sometimes it can't find very
> simple strings, for example : it can't find " ^??? " strings . I use
> these commands to find :
> Select * from MyDB where Contains(FName, N' ^??? ' )
> or
> Select * from MyDB where Contains(FName, ' ^??? ' )
> but no one can find the string.
> please tell me what is wrong in command or what can I do to solve this
> problem.
> In addition , I want to send result of Select @.@.version command for you
..
> Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
> Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on
Windows
> NT 5.0 (Build 2195: Service Pack 4)
> ----
> Also the Collation of Database and FName-field is :
> SQL_Latin1_General_CP1_CI_AS
> Thanks in Advance
> Hamid.
>
>
Wednesday, March 7, 2012
Problem with repeater
I have a repeater and then a repeater inside that repeater.
<asp:SqlDataSource ID="sqlRepeater1" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT count(*) as mycount FROM insuranceco with (NOLOCK) where insurancecoid=@.insurancecoid" OnSelecting="sqlRepeater_Selecting" >
<SelectParameters>
<asp:Parameter DefaultValue='' Name="insurancecoid" Type="String" />
</SelectParameters>
</asp:SqlDataSource
<%
'sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
%
This returns:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'sqlRepeater1' is not declared.
Source Error:
Line 38:
Line 39: <%
Line 40: sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
Line 41: %>
Line 42:
I tried a solution i saw on the web about using the onselecting event but that didn't pan out either
Protected Sub sqlRepeater_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) 'Handles sqlRepeater1.Selecting WithEvents
'Response.Write(e.Command.Parameters.Add)
'e.Command.Parameters.Add(e.Command.CreateParameter("P1", "test"))
'e.Command.Parameters.Add("P1", "value")
I have to be doing something wrong because i would think there has to be a way to reference variables when you are going from repeater to repeater i just dont know.
Please help my mask of sanity is starting to slip off.
Thanks
You can put this line in any event in the code behind file:
sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
You're using SqlDataSource yet I haven't seen where is the repeater.
sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
in the codebehind now and see what happens.
<%@. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ProcessOrders.aspx.vb" Inherits="ProcessOrders" title="Process Inspection Orders" %
<asp:Content ID="Content1" ContentPlaceHolderID="CPH1" Runat="Server"
<h1>Process Inspection Orders</h1>
<hr /
<asp:SqlDataSource ID="InspectionCompanys" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="select inspectioncompany,inspectioncoid from inspectionco with (NOLOCK)"
</asp:SqlDataSource
<asp:SqlDataSource ID="sqlRepeater" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT insurancecompany,insurancecoid FROM insuranceco with (NOLOCK) ">
</asp:SqlDataSource
<asp:Repeater id="ProcessOrder" EnableViewState="False" runat="server" DataSourceID="sqlRepeater">
<HeaderTemplate>
<table width="600" cellpadding="3" cellspacing="0">
</HeaderTemplate>
<ItemTemplate
<asp:SqlDataSource ID="sqlRepeater1" runat="server" ConnectionString="<%$ ConnectionStrings:Inspections_DBCS %>"
SelectCommand="SELECT count(*) as mycount FROM insuranceco with (NOLOCK) where insurancecoid=@.insurancecoid" OnSelecting="sqlRepeater_Selecting" >
<SelectParameters>
<asp:Parameter DefaultValue='' Name="insurancecoid" Type="String" />
</SelectParameters>
</asp:SqlDataSource
<%
sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
%
<tr>
<td style='width: 35%; height: 32px'>
<asp:Label ID="lblViewCompanyName" runat="server" Text='<%# EVAL("InsuranceCompany") %>'/></td>
<td style='height: 32px'>
<asp:Repeater ID="InsideLoop" EnableViewState=false runat="server" DataSourceID="SqlRepeater1">
<ItemTemplate>
<asp:Label ID="numberofrecords" runat="server" Text='<%# EvaL("mycount") %>'/>
</ItemTemplate>
</asp:Repeater
</td>
<td style='height: 32px'>
<asp:Label ID="lblInspectionCompany" runat="server" Text="Inspection Company:"/></td>
<td style='height: 32px'>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="InspectionCompanys" DataTextField="inspectioncompany" DataValueField="inspectioncoid" Value="test" />
</td>
<td>
<asp:Label runat="server" ID="lblAssignDate" Text="Assign Date:"></asp:Label><asp:TextBox ID="txtAssignDate1" runat="server"/>
</td>
<td>
<asp:Button ID="btAssign" runat="server" Text="Assign" />
</td>
</tr>
</ItemTemplate>
<SeparatorTemplate>
<!--<hr />-->
</SeparatorTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</asp:Content|||Here is the codebehind
Imports System.Data
Imports System.Data.SqlClient
Public Class ProcessOrders
Inherits Page
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Call BuildUserGrid()
End Sub
Sub BuildUserGrid(ByRef txtAssignDate As TextBox)
'ProcessOrder.DataSource = GetOrder()
'ProcessOrder.DataBind()
'Call GetOrder()
txtAssignDate.Text = "TEST"
End Sub
Function GetOrder() As DataView
Dim dstUsers As DataSet
Dim objConnection As SqlConnection
Dim dadResults As SqlDataAdapter
Dim dvwUsers As DataView
Dim strServer As String 'Which server is this connection
Dim strDatabase As String 'Which database is this connection
Dim strUserID As String 'What SQL Server UserName
Dim strPassword As String 'What SQL Server Password
Dim strQuery As String 'My SQL QUERY
strServer = ConfigurationSettings.AppSettings("server")
strDatabase = ConfigurationSettings.AppSettings("database")
strUserID = ConfigurationSettings.AppSettings("userid")
strPassword = ConfigurationSettings.AppSettings("password")
strQuery = "SELECT insurancecompany "
strQuery = strQuery & "FROM insuranceco with (NOLOCK) "
Response.Write("WOW")
'dvwUsers = Cache("MyInspection")
If dvwUsers Is Nothing Then
dstUsers = New DataSet()
objConnection = New SqlConnection("Server=" & strServer & ";UID=" & strUserID & ";PWD=" & strPassword & ";Database=" & strDatabase)
dadResults = New SqlDataAdapter(strQuery, objConnection)
dadResults.Fill(dstUsers, "MyInspection")
dvwUsers = dstUsers.Tables("MyInspection").DefaultView()
'Cache("MyInspection") = dvwUsers
End If
'objConnection.Close()
Return dvwUsers
End Function
Protected Sub sqlRepeater_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) 'Handles sqlRepeater1.Selecting WithEvents
'Response.Write(e.Command.Parameters.Add)
'e.Command.Parameters.Add(e.Command.CreateParameter("P1", "test"))
'e.Command.Parameters.Add("P1", "value")
'insurancecoid
End Sub
End Class|||When i put the sqlrepeater1 line it gives me an error.
But it only errors when i have the repeater inside the first repeater.
Is it impossible to do a repeater inside a repeater? Is there some longer way to reference a variable when you are inside a repeater because it just seems like it is something to do with being inside repeater #1.
If i put the 2nd repeater (sqlrepeater1) and the code outside of the first repeater it works.
Compiler Error Message: BC30451: Name 'sqlRepeater1' is not declared.
Source Error:
Line 73: 'insurancecoid
Line 74:
Line 75: sqlRepeater1.SelectParameters["insurancecoid"].DefaultValue = "123";
Line 76: End Sub
Line 77: End Class
Problem with queued updating in transactional repl on win/SQL 2000
subscriber. Now, there is a queued updating setup between this two with push
replication. I'm trying to replicate the employees table of Northwind
database only. the primary key is setup to use identity ranges on the 2
servers. The problem I'm facing is that, when I insert/update data on a
publisher, it gets replicated fine to subscriber, no matter what. But, when I
try to insert data at the subscriber, it doesn't work(update works fine). It
gives me an error msg2627. violation of a primary key constraint at the
subscriber. It says 'cannot insert duplicate key in object 'Employees'. The
thing is that I'm using identity for the primary key. So, I'm very confused
as to what this is saying. Please help. Thank you.
Tejas,
sounds like you haven't set up automatic identity range management, and hte
identity values are clashing. In the article properties you can see this
option, but it'll require reinitialization. As a stop-gap you could reseed
the identity range on the subscriber (dbcc checkident).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)