Any help?
Any help would be greatly appreciated
Originally Posted by: Zero2Cool
I am not sure specifically what you are seeking help with.
What input for the SP's are you having troubles with?
Are you getting any errors?
Below is code that I am using to tie messages to a specific TopicID. I don't know if this will help, but you'll see the parameters you must include and the Flags value to use.
private bool InsertMessage(MessageImportItem M, int GameDayTopicID, long messageID)
{
try
{
using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["yaf"].ConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("yaf_message_save", connection))
{
command.CommandType = CommandType.StoredProcedure;
var paramMessageID = new SqlParameter("@MessageID", messageID) { Direction = ParameterDirection.Output };
//command.Parameters.Add(new SqlParameter("@MessageID"));
command.Parameters.Add(new SqlParameter("@TopicID", GameDayTopicID));
command.Parameters.Add(new SqlParameter("@UserID", M.UserID));
command.Parameters.Add(new SqlParameter("@Message", M.Message));
command.Parameters.Add(new SqlParameter("@UserName", M.Username));
command.Parameters.Add(new SqlParameter("@IP", M.IP));
command.Parameters.Add(new SqlParameter("@Posted", M.Posted));
command.Parameters.Add(new SqlParameter("@ReplyTo", messageID));
//command.Parameters.Add(new SqlParameter("@BlogPostID nvarchar(50) = null,
//command.Parameters.Add(new SqlParameter("@ExternalMessageId nvarchar(255) = null,
//command.Parameters.Add(new SqlParameter("@ReferenceMessageId nvarchar(255) = null,
command.Parameters.Add(new SqlParameter("@Flags", 22));
command.Parameters.Add(new SqlParameter("@UTCTIMESTAMP", M.Posted));
command.Parameters.Add(paramMessageID);
messageID = (long)paramMessageID.Value;
command.ExecuteNonQuery();
return true;
}
}
}
catch (Exception ex)
{
ShowAlert("danger alert-dismissible", "x", "SQL", ex.Message);
return false;
}
}
Originally Posted by: Hamid1920