Hi mumfie2003, Can you be more explicit about how and where can I increase the timeout? I have a CommentUtiliy CS file in C:\...\...\CSKDotNet\Engine\Framework\Comments\Components It reads as follows:
namespace ASPNET.StarterKit.Communities {
using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
//*********************************************************************
//
// CommentUtility Class
//
// Contains static utility methods used by the Comments module.
//
//*********************************************************************
public class CommentUtility {
//*********************************************************************
//
// AddComment Method
//
// Adds a new comment to the database.
//
//*********************************************************************
public static int AddComment
(
int contentPageID,
ModerationStatus moderationStatus,
string username,
string title,
string body
) {
SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
SqlCommand cmdAdd = new SqlCommand("Community_CommentsAddComment", conPortal);
cmdAdd.CommandType = CommandType.StoredProcedure;
// Add Parameters
cmdAdd.Parameters.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;
cmdAdd.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
cmdAdd.Parameters.Add("@contentPageID", contentPageID);
cmdAdd.Parameters.Add("@moderationStatus", moderationStatus);
cmdAdd.Parameters.Add("@username", username);
cmdAdd.Parameters.Add("@title", title);
cmdAdd.Parameters.Add("@metaDescription", ContentPageUtility.CalculateMetaDescription(body));
cmdAdd.Parameters.Add("@metaKeys", ContentPageUtility.CalculateMetaKeys(body));
cmdAdd.Parameters.Add("@body", SqlDbType.NText);
cmdAdd.Parameters[ "@body" ].Value = body;
conPortal.Open();
cmdAdd.ExecuteNonQuery();
int result = (int)cmdAdd.Parameters["@RETURN_VALUE"].Value;
conPortal.Close();
return result;
}
//*********************************************************************
//
// GetComment Method
//
// Gets a particular comment from the database.
//
//*********************************************************************
public static ContentInfo GetComment(string username, int contentPageID) {
CommentInfo comment = null;
SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
SqlCommand cmdGet = new SqlCommand("Community_CommentsGetComment", conPortal);
cmdGet.CommandType = CommandType.StoredProcedure;
// Add Parameters
cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
cmdGet.Parameters.Add("@username", username);
cmdGet.Parameters.Add("@contentPageID", contentPageID);
// Get Comment from DB
conPortal.Open();
SqlDataReader dr = cmdGet.ExecuteReader();
if (dr.Read())
comment = new CommentInfo(dr);
conPortal.Close();
return (ContentInfo)comment;
}
//*********************************************************************
//
// GetComments Method
//
// Retrieves a list of comments from the database.
//
//*********************************************************************
public static CommentCollection GetComments(string username, int contentPageID, int orderBy) {
SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString);
SqlCommand cmdGet = new SqlCommand("Community_CommentsGetComments", conPortal);
cmdGet.CommandType = CommandType.StoredProcedure;
// Add Parameters
cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID);
cmdGet.Parameters.Add("@username", username);
cmdGet.Parameters.Add("@contentPageID", contentPageID);
cmdGet.Parameters.Add("@orderBy", orderBy);
CommentCollection colComments = new CommentCollection();
conPortal.Open();
SqlDataReader dr = cmdGet.ExecuteReader();
while (dr.Read())
colComments.Add(new CommentInfo(dr));
conPortal.Close();
return colComments;
}
}
}
euroiranian
Member
375 Points
75 Posts
Re: URGENT. Timeout Expired. Error.
Sep 20, 2004 09:26 AM|LINK
namespace ASPNET.StarterKit.Communities { using System; using System.Data; using System.Data.SqlClient; using System.Collections; //********************************************************************* // // CommentUtility Class // // Contains static utility methods used by the Comments module. // //********************************************************************* public class CommentUtility { //********************************************************************* // // AddComment Method // // Adds a new comment to the database. // //********************************************************************* public static int AddComment ( int contentPageID, ModerationStatus moderationStatus, string username, string title, string body ) { SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString); SqlCommand cmdAdd = new SqlCommand("Community_CommentsAddComment", conPortal); cmdAdd.CommandType = CommandType.StoredProcedure; // Add Parameters cmdAdd.Parameters.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue; cmdAdd.Parameters.Add("@communityID", CommunityGlobals.CommunityID); cmdAdd.Parameters.Add("@contentPageID", contentPageID); cmdAdd.Parameters.Add("@moderationStatus", moderationStatus); cmdAdd.Parameters.Add("@username", username); cmdAdd.Parameters.Add("@title", title); cmdAdd.Parameters.Add("@metaDescription", ContentPageUtility.CalculateMetaDescription(body)); cmdAdd.Parameters.Add("@metaKeys", ContentPageUtility.CalculateMetaKeys(body)); cmdAdd.Parameters.Add("@body", SqlDbType.NText); cmdAdd.Parameters[ "@body" ].Value = body; conPortal.Open(); cmdAdd.ExecuteNonQuery(); int result = (int)cmdAdd.Parameters["@RETURN_VALUE"].Value; conPortal.Close(); return result; } //********************************************************************* // // GetComment Method // // Gets a particular comment from the database. // //********************************************************************* public static ContentInfo GetComment(string username, int contentPageID) { CommentInfo comment = null; SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString); SqlCommand cmdGet = new SqlCommand("Community_CommentsGetComment", conPortal); cmdGet.CommandType = CommandType.StoredProcedure; // Add Parameters cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID); cmdGet.Parameters.Add("@username", username); cmdGet.Parameters.Add("@contentPageID", contentPageID); // Get Comment from DB conPortal.Open(); SqlDataReader dr = cmdGet.ExecuteReader(); if (dr.Read()) comment = new CommentInfo(dr); conPortal.Close(); return (ContentInfo)comment; } //********************************************************************* // // GetComments Method // // Retrieves a list of comments from the database. // //********************************************************************* public static CommentCollection GetComments(string username, int contentPageID, int orderBy) { SqlConnection conPortal = new SqlConnection(CommunityGlobals.ConnectionString); SqlCommand cmdGet = new SqlCommand("Community_CommentsGetComments", conPortal); cmdGet.CommandType = CommandType.StoredProcedure; // Add Parameters cmdGet.Parameters.Add("@communityID", CommunityGlobals.CommunityID); cmdGet.Parameters.Add("@username", username); cmdGet.Parameters.Add("@contentPageID", contentPageID); cmdGet.Parameters.Add("@orderBy", orderBy); CommentCollection colComments = new CommentCollection(); conPortal.Open(); SqlDataReader dr = cmdGet.ExecuteReader(); while (dr.Read()) colComments.Add(new CommentInfo(dr)); conPortal.Close(); return colComments; } } }Thanks a lot.