Using Signalr In dnn - signalr

I am using signalr library in my DotnetNuke module.
Currently I have inserted the follwing record to hostsettings table in DNN DB
insert into hostsettings
(SettingName
, SettingValue
, SettingIsSecure
, CreatedByUserId
, CreatedOnDate
, LastModifiedByUserId
, LastModifiedOnDate
)
values(
'AUM_DoNotRewriteRegEx'
,'/DesktopModules/|/Providers|/LinkClick\.aspx|/SignalR'
, 0
, -1
, GETDATE()
, -1
, GETDATE()
)
So when i access my module using this url it works fine.
(http://dnndev.me/ChatModule)
But when i created a Child portal and add the module and tried to access using (http://dnndev.me/p3/ChatModule) it is giving me error "NetworkError: 404 Not Found - http://dnndev.me/p3/signalr/hubs"
Can someone guide me here to the correct path

Related

Replace Stored procedure failed ,Volatile table doesn't exist

This procedure already exists in database but when I tried to replace after making changes It's throwing error volatile table doesn't exist. Can you pls help identify the issue ? This failed while migrating to QA environment.
Statement 2: REPLACE PROCEDURE Failed.
Output directed to Answer window
SPL5000:W(L78), E(3807):Object 'VT_SEG' does not exist.
SPL1027:E(L165), Missing/Invalid SQL statement'E(3807):Object 'VT_SEG' does not exist.'.
SPL5000:W(L169), E(3807):Object 'VT_SEG' does not exist.
REPLACE PROCEDURE DB.SP_PNL ( IN P_EXTRACTSTARTDATE VARCHAR(35))
BEGIN
VT_SEG:BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
---- ERROR HANDLING HERE ----
END ;
DROP TABLE "VT_SEG";
END VT_SEG;
--LOAD THE TOPLINE DATA
CREATE MULTISET VOLATILE TABLE VT_SEG AS
( SELECT TIER
, JOB_ROLE
, REGION
, LOC_ID
, LOCATION
, WK_NUM
, YR_NUM+1 AS YR_NUM
, cast(sum(coalesce(VOL_RAW_CASES,0) ) as decimal(38,9)) as VOL_RAW_CASES
FROM DB1.VOL
GROUP BY 1,2,3,4,5,6,7
) WITH DATA
primary index (TIER,JOB_ROLE,LOC_ID,WK_NUM,YR_NUM)
ON COMMIT PRESERVE ROWS;
end;

Web Api 2-Specified cast is not valid

Whenever I put case in my query it gives an error of "Specified cast is not valid" in linq to sql C# but
Its working fine in Sql server 2008.
Below query iam using
select Prod_StyleID,S.STYLECODE,STYLENAME,CATEGORYNAME,VENDORNAME,STYLESTATUS,Gendername,
STYLEDESCRIPTION,SHORTDESCRIPTION1,SHORTDESCRIPTION2,SHORTDESCRIPTION3,SHORTDESCRIPTION4,STYLEPRICE,
BRANDNAME,VENDORSTYLECODE,CATEGORYTYPE,1 as ColorATtribute,1 as SizeAttribute,
case when s.styleprice = '0' then sp.regularprice when s.styleprice = '1' then
sp.saleprice else closeoutprice end as Regularprice from prod_style S inner join prod_styleprice SP on s.stylecode = sp.stylecode where (S.STYLECODE LIKE #stylecode+'%' OR S.VENDORSTYLECODE like #stylecode+'%')
and S.CATEGORYNAME <> 'Made to Order' and S.STYLESTATUS = 'Active' and sp.pricefrom ='1'
please help

Cannot SELECT properties created by a custom Alfresco model

After adding some custom properties to a content model I can not SELECT any of the newly added properties using a CMIS query.
After stopping Alfresco server and SOLR using the following command:
sudo /etc/init.d/tomcat6 stop \
I deleted the following folders:
alf_data/solr/workspace/SpacesStore/
alf_data/solr/archive/SpacesStore/
And deleted the contents of the following directories:
alf_data/solr/archive-SpacesStore/alfrescoModels
alf_data/solr/workspace-SpacesStore/alfrescoModels
and redployed my alfresco server.
My object Type ID is ai:bulletin and the property is ai:year
After the indeces were recreated I can successfully execute:
SELECT * FROM ai:bulletin
which returns ai:year as part of the returned data
but when trying the following query:
SELECT ai:year FROM ai:bulletin
I receive an exception and nothing is returned.
Any ideas of what I might be doing wrong?
First of all, why you would delete solr indexes? Anyway, for CMIS, in order for the custom properties to be viewed in the resultset, you need to join the aspects which contain your custom properties, and then list the custom properties you'd like to get. Otherwise you'll get the exception. Here is a query I used time ago, it's just for demonstration purposes. Hope it helps.
SELECT z.cmis:objectId, z.cmis:objectTypeId, z.cmis:name , db.fo:num_ord_barcode , db.fo:anno_cont_ord , di.fo:cod_ufficio , db.fo:cod_agente , db.fo:partita_iva , db.fo:provincia , db.fo:check_ord_barcode , db.fo:data_ord , db.fo:cod_gruppo , db.fo:cod_zona , db.fo:cod_distretto , db.fo:mese_cont_ord , db.fo:nominativo , db.fo:localita , db.fo:cod_fisc , di.fo:num_distinta , di.fo:data_distinta , cc.fo:cod_cliente , fa.fo:num_fatt , fa.fo:data_fatt , tf.fo:tipologia_fattura FROM fo:fattura_folletto z JOIN fo:fattura_folletto tf ON z.cmis:objectId = tf.cmis:objectId JOIN fo:aspetto_fattura fa ON z.cmis:objectId = fa.cmis:objectId JOIN fo:aspetto_doc_base db ON z.cmis:objectId = db.cmis:objectId JOIN fo:aspetto_distinta di ON z.cmis:objectId = di.cmis:objectId JOIN fo:aspetto_cod_cliente cc ON z.cmis:objectId = cc.cmis:objectId WHERE db.fo:nominativo like '%YOUR SEARCH STRING%'

subquery that starts with "with" in teradata is not working

I have a query (that I cannot modify) that starts like this
with CodeSet (
code_context_c
, bom_index_c
, src_qs_c
, src_code_set_c
, src_code_set_x
, src_code_value_c
, src_code_value_x
, tgt_code_set_c
, tgt_code_value_c
) as (
SELECT ...
and then goes on. Now I need to use it as a subquery and do something like
select * from (with CodeSet (
code_context_c
, bom_index_c
, src_qs_c
, src_code_set_c
, src_code_set_x
, src_code_value_c
, src_code_value_x
, tgt_code_set_c
, tgt_code_value_c
) as (
SELECT ...
but Teradata does not like it... Anyone has seen this before? Changing the query would require some time and I would prefer not to. Anyone can help me out here?
Error message is:
SELECT Failed. [3707] Syntax error, expected something like a name or a Unicode delimited identifier or '(' between the 'from' keyword and the 'as' keyword.
Thanks in advance,
Umberto
Not sure if you are still looking for the answer, but you need to run the SELECT after your WITH statement. WITH doesn't actually materialize a table until you SELECT from it. So something like this:
;WITH CodeSet (
blah
, blah
, ...
) AS (
SELECT blah
, blah
, ...
)
;
SELECT * FROM CodeSet;

How do I create a new database on SQL Server in a unique new name?

I'm using Visual Studio 2010 ASP.NET with C# on .NET 4.0 and SQL Server 2008 R2.
I would like to create a database on the server named WINSRV\SQLSRV.
How do I loop to test for a unique database name?
My default database should be ab. In case this name is taken, I would like to create a database named ab1, and if this one is also taken - ab2 and so forth.
I need it to rum from a web page created in the Visual Studio 2010 ASP.NET C# script, and not from the SQL server management studio.
Thanks.
Declare #Iteration int
Set #Iteration = 0
Declare #DBName varchar(100)
while(#Iteration <> -1)
begin
if(#Iteration = 0)
Set #DBName = 'ab'
Else
Set #DBName = 'ab' + Convert(varchar, #Iteration)
IF NOT EXISTS(select Object_Id from sys.databases where name = 'ab')
Begin
Exec('create database ' + #DBName)
return;
End
Else
Begin
Set #Iteration = #Iteration + 1
End
End
Edit
To Work from C# click here
You will want to check to see if your choices for databases exist:
You can do it primary sql side as so:
IF (EXISTS (SELECT name FROM master.sys.databases WHERE name = 'ab')))
--Do what you need to do
or you could get a list databases and check .net side:
SELECT name FROM master.sys.databases
Hope this helps.

Resources