Bineeshcp Viswanath

Bineeshcp Viswanath

  • NA
  • 140
  • 39.3k

Singalr connection not working in hosted database in GoDaddy

Apr 23 2019 3:48 AM
Dear All,
 
I have hosted ASP.NET web application & SQL server 2012 database in GoDaddy server. It working fine except signalr functionality.
 
The following error is coming in c# code:-
 
Cannot find the object "QueryNotificationErrorsQueue" because it does not exist or you do not have permissions.
 
The signalr functionality is working fine whe I connect the same application to my local DB.
 
c# code for retreiving data:-
 
[WebMethod]
public static IEnumerable<Products> GetData()
{
SqlDataReader reader;
try
{
using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DataBase"].ConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("SELECT Note,NotificationType,cast(Convert(varchar(20),ActionDate,103) as nvarchar(20)) as dd FROM tblNotification WHERE IsRead=0 AND VID='" + HttpContext.Current.Session["VID"].ToString() + "' and ReceiverID='" + HttpContext.Current.Session["CustomerUserID"].ToString() + "' Order By ActionDate DESC", connection))
{
command.Notification = null;
SqlDependency.Start(ConfigurationManager.ConnectionStrings["DataBase"].ConnectionString);
//SqlDependency.Start(connection.ToString());
SqlDependency dependency = new SqlDependency(command);
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
if (connection.State == ConnectionState.Closed)
connection.Open();
using (reader = command.ExecuteReader())
return reader.Cast<IDataRecord>()
.Select(x => new Products()
{
Note = x.GetString(0),
NotificationType = x.GetString(1),
dd = x.GetString(2)
}).ToList();
}
}
}
catch (Exception ex)
{
throw;
}
}

Answers (1)