|
Is it SQL Server database ? If yes have checked Execution Plan of store procedure and other queris.
Thanks and Regards,
Arif.
Life Is Beautiful
|
|
|
|
|
You need to start by measuring where the performance problem is.
- Is the query slow to execute from SSMS?
- Does it take a long time for ASP.NET to read the results of the query?
- Is ASP.NET taking a long time to bind the data and build the control hierarchy?
- If the generated output is large, is it taking a long time to download to the browser?
- If the generated output is very large, is it taking a long time for the browser to render it?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All,
I have a secure webservice which I want to call using jquery.The webservice require credentails to conneccto to it. I know how to call webservice which is not secure.Can any one please help me for this.
Thanks,
Arif
Life Is Beautiful
|
|
|
|
|
I know there is tons on the web about things like remote powershell and UserPrincipal/PrincipalContext being slow but I cannot seem to find the answer to the problem
Basically my login page authenticates the user against active directory. I am experiencing anywhere between 1-2 minutes on the first try. Each try after that seems to be faster.
What I am doing on authentication is this:
* I use PrincipalContext and call ValidateCredentials
* Using the same PrincipalContext I call UserPrincipal.FindByIdentity (using UserPrincipalName)
* I get the groups the user belongs to and send back to the calling method (using .GetGroups())
* I then create the forms authentication ticket and call Response.Redirect if the user authenticated
Is there a better way to achieve this upon login? I need to be able to authenticate the user and get the user's groups when they login.
|
|
|
|
|
Hey friends...I am creating an online examination project...I have made the login...the admin part and even all the databse thing is done...but in the user side as i press the start exam button it givving "Object reference not set to an instance of an object. " error...please help me out ASAP...m about to meet the deadlines..and if i meet it i ll be dead...
here's my code..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Instruction : System.Web.UI.Page
{
OnlineExamsDataContext _mycontext = new OnlineExamsDataContext();
string username;
protected void Page_Load(object sender, EventArgs e)
{
username = Request.QueryString["username"].ToString();
lbluname.Text = "Welcome :" + username;
lbldate.Text = System.DateTime.Now.ToString();
}
protected void btnstart_Click(object sender, EventArgs e)
{
int emailid;
emailid = _mycontext.ExamTableInsert (Convert.ToDateTime (System.DateTime.Now.ToShortDateString()), Convert.ToInt32 (Request.QueryString["UserID"].ToString()), Convert.ToDecimal("0.0"));
Response.Redirect("QuestionPaper.aspx");
}
protected void lbtnresult_Click(object sender, EventArgs e)
{
Response.Redirect("Examresult.aspx");
}
}
|
|
|
|
|
it says Object reference not set to an instance of an object. is in the line which i have underlined....:'(
|
|
|
|
|
Hey,
Make sure your query string "username" exists.
You are getting this error because you are trying to convert the a query string that is null to a string.
best is to add an if statement:
if (Request.QueryString["username"] != null) {
username = Request.QueryString["username"].ToString();
lbluname.Text = "Welcome :" + username;
lbldate.Text = System.DateTime.Now.ToString();
} else {
}
|
|
|
|
|
It is always best practice to convert object with Convert.ToString(Request.QueryString["username"]) instead of .ToString().Check whether you are getting username value as null.
Life Is Beautiful
|
|
|
|
|
Since Request.QueryString[key] already returns a string , there's absolutely no need to call either Convert.ToString or .ToString() to convert it to a string.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Just drop the .ToString() call - Request.QueryString["username"] already returns a string .
username = Request.QueryString["username"];
You also need to HTML-encode the value before you display it, to avoid cross-site scripting (XSS)[^]:
lbluname.Text = "Welcome :" + HttpUtility.HtmlEncode(username)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Object reference not set to an instance of an object. it really means that when you request this page ,you haven't passed a param in the request. why not check the former page which entry this one?
|
|
|
|
|
Is the value "username" correctly being passed in the querystring. The statement "Request.QueryString["username"].ToString();" is not getting the value from the querystring hence the error
|
|
|
|
|
Is there a way to embed an image in a datagrid without using url in a image tag? I want to embed an image in a telerik radgrid so i can export it to excel with the actual image. I tried data uri but excel does not support it. Any Ideas?
|
|
|
|
|
I ought to redirect my website from non-www to www on IIS 6. e.g if I enter domain.com in the url, it has to redirect to www.domain.com for SEO optimization.
I followed the video "http://www.youtube.com/watch?v=PYxabNrIMQ4" for creating my rewrite rule. And I made it as below
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to www" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="mydomain.com" />
</conditions>
<action type="Redirect" url="http://www.mydomain.com/{R:0}" />
</rule>
</rules>
</rewrite>
But it is not working as expected. Help me out to find the solution.
Note: My Visual studio shows warning like "The element 'system.webServer' has invalid child element 'rewrite'".
I believe it doesn't make any problem.
|
|
|
|
|
|
Hi Friends,
I have DropdownList, Textbox and RegularExpression Validator in Gridview's ItemTemplate. RegularExpressionValidator is to validate the percentage in Textbox entry.
This RegularExpressValidator should enable only based on dropdownlist selection. i.e., if dropdownlist selection is "Percentage" then, validator should enable to validate textbox entry.
I have tried many ways in Javascript and .cs code, but no luck.
Please help in this.
Regards,
Priyaa.
|
|
|
|
|
Replace you RegularExpression Validator with a Custom Validator, then you can use string.match js method to validate you textbox.
here is a link on how to use the string.match() method:
string.match()
|
|
|
|
|
Hi,
you can use dropdown selected index changed event on dropdownlist.
means if your regular expression validator id is regular1 then just false its visibility from server side as reqular1.Visible=false;
try it.
this can also done by Jquery.
|
|
|
|
|
|
i am having the problem with insert / update nvarchar model data in Entity Framework ( Asp.net 4.0 - MVC 4 )
In SQL Server 2008, i have "PhoneNo" [nvarchar(60)] column in UserInfo table.
Via Entity framework i can able to update from 1 to 30 characters only (which means 50% in that datatype. if length is 100, i can able to save from 1 to 50). Suppose if i give more than 30 chars then throws exception.
{"String or binary data would be truncated.\r\nThe statement has been terminated."}
Note: Using sql server query i can able to save upto 60 chars. but entity framework i can't.
Please provide me the solution for this issue.
Thanks in advance.
With Regards
Ganesan.M
|
|
|
|
|
Hey all
Hope someone could help with some advice i am considering building a site where users can read reviews on different products. Also i would like to create a mobile platform to allow users, on the go, to read reviews.
But i am a bit lost in relation to how the system should be build, either i should build from scratch this would give me complete control but also in my view be very time consuming, or should i use Umbraco as base of for my site?
If i choose umbraco should i create my own tables for product storage or use umbraco's document type, here i am thinking about how to later extract data using a web service.
any input would be appreciated
|
|
|
|
|
Edit GridView Row not working when new row is inserted on GridView RowCreated
Requirement:
Display data in a GridView Control
1. Group by particular column called "Region"
2. Also display total sum of revenue for each region
3. Column called "Remarks" should be editable
Problem:
I am unable to edit the Column
(since i have inserted rows which displays sum for each region)
The Row Edit index gets updated due to which i am facing this problem
Solutions Tried:
Created a template field with a button in it (Still not able to Edit)
Request the members to help me on this.
|
|
|
|
|
Dear all,
I am currently beginner into this web api applications. I require a little help in how do I go about retrieving previous day's data using entity framework from 'GET' method.
I have constructed the following the code but I cannot get seem to get it work:
The following code is in the WIC controller class.
public database_WICs Getdatabase_WICs(DateTime UploadDate)
{
database_WICs database_wics = db.database_WICs.Find(UploadDate);
string yesterday = DateTime.Today.AddDays(-1).ToShortDateString();
if (database_wics == null)
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
}
return database_wics;
}
Any help would be very much appreciated.
Thank you
|
|
|
|
|
Quote:
string yesterday = DateTime.Today.AddDays(-1).ToShortDateString();
What this line for?
You mean to do this before and pass yesterday to the db?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Thank you for your reply.
I changed the above line to the following below:
string yesterday = db.database_BWICs.Find(d => d.UploadDate == yesterday);
Whenever I add
db.database_WICs.Find(d => d.UploadDate == yesterday
I get the following error in the code:
"Cannot convert lambda expression to type 'object[]' because it is not a delegate type."
I can not seem to figure out why.
Any help would be very much appreciated.
Thank you
|
|
|
|