|
Hi All,
I am Developing a web base project using asp.net mvc 2.0 architecture for my current window based application.
The following things will be used in my project.
1.The Menu and sub Menus
2.Support for multiple database
3.The view for displaying record fetch from the database
4.Making connection to service
so if anybody can give the url for similar projects which i can refer to it will be quite helpful
Thanks in advnace
Ramesh singh
|
|
|
|
|
See here: ASP.Net MVC[^]
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
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");
}
|
|
|
|
|
|
Not an answer, but a question - Why are you creating the SP in your code?
Shreekar
|
|
|
|
|
Is the data the same in the two systems? Are you sure the query returns anything?
From the documentation for ExecuteScalar:
The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is empty.
You could try getting rid of the output parameter and just using a SELECT instead of a SET and RETURN.
Also, look into @ strings rather than lots of concatenation.
|
|
|
|
|
Hi,
I want to use progress bar in my webpage.
I dont want third party control.
How can i use AJAX updateprogress.
Thanks
sjs4u
|
|
|
|
|
|
Hi Freanids,
I am using a Gridview in my project but when i implement sorting on columns its giving following error randomly,
Error is bellow:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Kindly help me on this issue, how i resolve it.
Thanks in advnace
Arsad
|
|
|
|
|
Did you try to google [^]the error message?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi Manas,
Thanks for your suggestion on this actually i tried it before but i didn't succeed at that time as the most of comments suggest to add commond timeout attribute in connection string, for now i again implement it at this time no error occured, as i say it was randomly occur so hoping for best.
Thanks for help
Abbas
|
|
|
|
|
The query timeout happens for the query. So next time it happens, check the query that is executed. Compare it with the query that does not time out.
Maybe that will help?
Shreekar
|
|
|
|
|
|
I want to rewrite the url based on query string in asp.net with c#. it means if url comes
http://app.tasktrek.in/Citylist.aspx?Id=1
then it should be look like
http://app.tasktrek.in/Citylist.aspx/Noida in url
where Id=1 for noida ,
Also have any solution in which I do not want to confiure IIS?
How to do it in asp.net .
|
|
|
|
|
|
Hi Abhijit I studied the above url that u have sent but i am not getting any changes in url when implement.
Actually i want if incoming url is http://localhost:53365/UrlRewrite/City.aspx?Id=1"
then it convert into http://localhost:53365/UrlRewrite/City.aspx/Noida
where noida is cityname that depends on querysring value.
please help me.
|
|
|
|
|
|
Hi all,
I have stucked in regualar expression replace, please help me out
My scenario is as follow
I need to replace the "Anyvalue" with "SomeValue" in following string where "Anyvalue" can be different in different instance.
<?xml version='1.0' encoding='Anyvalue'?>
Any suggestion would be highly appreciable.
Thanks
Rohit
|
|
|
|
|
Rohit16db wrote: where "Anyvalue" can be different in different instance.
I didn't get this point. You mean, "AnyValue" can be different ? And for that values you want to replace with "SomeValue" ?
Can you please let us know what exactly is your business requirments ?
|
|
|
|
|
Consider the following scenario
<?xml version='1.0' encoding='abc'?>
<?xml version='1.0' encoding='def'?>
<?xml version='1.0' encoding='xyz'?>
I need to replace all above kind of string to
<?xml version='1.0' encoding='XYZ'?>
hope this will make sense.
Thanks
Rohit
|
|
|
|
|
I am using ajax scriptmanager to update system time on the webpage. the corresponding code was placed in ContentTemplate. The text out side the contentTemplate also refreshing instead of partial refresh of the page.
pls help me.
code: aspx
------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax.aspx.cs" Inherits="WebApplication1.Ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label2" runat="server" Text="My System time:"></asp:Label>
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="500" ontick="Timer1_Tick" />
</div>
</form>
</body>
</html>
//server side code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication1
{
public partial class Ajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
Label1.Text = System.DateTime.Now.ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.ToString();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = System.DateTime.Now.ToString();
}
}
}
Pls help to resolve this problem
|
|
|
|
|
The easiest way is move your timer control into
<asp:updatepanel>
<asp:timer>
Make it better.
|
|
|
|
|
|
Hi ,
I am using a gridview control and a calender control but the they both are having javascript_dopostback event which does not work if the JavaScript is disable at client browser , please suggest some alternative to this so that the control even work without enabling the javascript at browser end.
with regards
|
|
|
|
|
digitaldxb wrote: please suggest some alternative to this so that the control even work without enabling the javascript at browser end
If you want to have an application that can work in the environment that has disabled JS then best is to avoid any client side coding in your application.
Whatever you are trying to achieve using javascrip_dopostback - remove it and have a server code for it. Have complete postbacks and perform user interactions server side. Use only server controls and server events. (If your calendar is having any client event, use a server calendar control!)
|
|
|
|