Click here to Skip to main content
15,890,897 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDynamic grid problem Pin
Amit Patel198517-Jun-10 1:19
Amit Patel198517-Jun-10 1:19 
QuestionHttpContext.Current.Server.MapPath Pin
KishoreT17-Jun-10 0:03
KishoreT17-Jun-10 0:03 
AnswerRe: HttpContext.Current.Server.MapPath Pin
Jens Meyer17-Jun-10 1:18
Jens Meyer17-Jun-10 1:18 
AnswerRe: HttpContext.Current.Server.MapPath Pin
KishoreT17-Jun-10 2:02
KishoreT17-Jun-10 2:02 
QuestionAjaxPro and Actionchart issue? Pin
Jeneesh K. Velayudhan16-Jun-10 23:17
Jeneesh K. Velayudhan16-Jun-10 23:17 
QuestionASP.Net MVC 2.0 Sample Project Required Pin
Member 401661616-Jun-10 22:46
Member 401661616-Jun-10 22:46 
AnswerRe: ASP.Net MVC 2.0 Sample Project Required Pin
R. Giskard Reventlov16-Jun-10 23:12
R. Giskard Reventlov16-Jun-10 23:12 
Questionreturning null value from procedure Pin
developerit16-Jun-10 22:05
developerit16-Jun-10 22:05 
hi iam using asp.net2.0 with c# with sql server 2000

when iam executing the procedure in local system it is working fine.but when iam executing in client system procedure returns null value, i have checked all connection string , and session value all are working


can you correct the code which helps me


SqlConnection concreate = new SqlConnection(strcon);

string pp = "";
pp = "create procedure getsum( @BranchKey int,@FromDate smalldatetime,@ToDate smalldatetime, @tot decimal output )";
pp += "as";
pp += "\n";
pp += "set @tot=(SELECT  SUM(Amount) FROM   AllTransactions WHERE BranchKey=@BranchKey  and  (TransCode <> 0) and (TransDate > @FromDate) and (TransDate < @ToDate)  GROUP by  BranchKey)";
pp += "return @tot";
pp += ";";


SqlCommand cmdcreate = new SqlCommand(pp, concreate);
concreate.Open();
cmdcreate.ExecuteNonQuery();
concreate.Close();


SqlConnection conproc = new SqlConnection(strcon);
conproc.Open();
SqlCommand cmdproc = new SqlCommand("getsum", conproc);
cmdproc.CommandType = CommandType.StoredProcedure;


cmdproc.Parameters.AddWithValue("@BranchKey", Convert.ToInt32(Session["BranchKey"]));
DateTime dt = Convert.ToDateTime(txtfrom.Text.ToString());
string fromDate = dt.ToShortDateString();
DateTime dt1 = Convert.ToDateTime(txtto.Text.ToString());
string toDate = dt1.ToShortDateString();
cmdproc.Parameters.AddWithValue("@FromDate", fromDate);
cmdproc.Parameters.AddWithValue("@ToDate", toDate);

SqlParameter p1 = cmdproc.Parameters.Add("@tot", SqlDbType.Decimal);
p1.Direction = ParameterDirection.Output;
if ((cmdproc.ExecuteScalar() != DBNull.Value) && (cmdproc.Parameters["@tot"].Value) != DBNull.Value)
{
    decimal ot = Convert.ToDecimal(cmdproc.Parameters["@tot"].Value);
    if (ot != null)
    {
        txttotal.Text = ot.ToString();
        conproc.Close();
    }
}
else
{


    clsdataset.ShowAlertMessage("No Data");

}

AnswerRe: returning null value from procedure Pin
Tej Aj17-Jun-10 0:52
Tej Aj17-Jun-10 0:52 
QuestionRe: returning null value from procedure Pin
shreekar17-Jun-10 1:54
shreekar17-Jun-10 1:54 
AnswerRe: returning null value from procedure Pin
T M Gray17-Jun-10 10:13
T M Gray17-Jun-10 10:13 
QuestionUpdateprogress bar Pin
sjs4u16-Jun-10 21:39
sjs4u16-Jun-10 21:39 
AnswerRe: Updateprogress bar Pin
saini arun16-Jun-10 22:51
saini arun16-Jun-10 22:51 
QuestionGridview sorting Pin
Abbas_here16-Jun-10 21:13
Abbas_here16-Jun-10 21:13 
AnswerRe: Gridview sorting Pin
Manas Bhardwaj16-Jun-10 21:33
professionalManas Bhardwaj16-Jun-10 21:33 
GeneralRe: Gridview sorting Pin
Abbas_here17-Jun-10 0:53
Abbas_here17-Jun-10 0:53 
AnswerRe: Gridview sorting Pin
shreekar17-Jun-10 1:51
shreekar17-Jun-10 1:51 
GeneralRe: Gridview sorting Pin
Abbas_here17-Jun-10 3:33
Abbas_here17-Jun-10 3:33 
QuestionHow to rewrite the url ? Pin
Sudhanshu Mani Tripathi16-Jun-10 20:27
Sudhanshu Mani Tripathi16-Jun-10 20:27 
AnswerRe: How to rewrite the url ? Pin
Abhijit Jana16-Jun-10 20:50
professionalAbhijit Jana16-Jun-10 20:50 
GeneralRe: How to rewrite the url ? Pin
Sudhanshu Mani Tripathi17-Jun-10 3:03
Sudhanshu Mani Tripathi17-Jun-10 3:03 
AnswerRe: How to rewrite the url ? Pin
thatraja16-Jun-10 20:51
professionalthatraja16-Jun-10 20:51 
QuestionProblem in regular expression Pin
Rohit16db16-Jun-10 20:24
Rohit16db16-Jun-10 20:24 
AnswerRe: Problem in regular expression Pin
Abhijit Jana16-Jun-10 20:52
professionalAbhijit Jana16-Jun-10 20:52 
GeneralRe: Problem in regular expression Pin
Rohit16db16-Jun-10 21:04
Rohit16db16-Jun-10 21:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.