|
Yes i got it ur question and the link below is the gr8 link chekc it...it will solve ur problem.
Thanks and Regards
Aavesh
|
|
|
|
|
check this:
http://www.chami.com/tips/Internet/110599I.html
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Thanks, i ll have a check.
Thanks in advance,
Priya.
|
|
|
|
|
Hi, I have a aspx page with a GridView with Paging and Sorting enabled.
I opened a SQL Profiler to check at what times the stored procedure which fetches data to bind to GridView is being called.
When I go to another page and come back to the GridView page then the procedure does not get called. But when I use the paging feature of the GridView and try to see next 10 records on the second page of GridView, my profiler shows a call to the stored procedure which always returns say 100 rows.
If my procedure at the first place did give the GridView all the 100 rows then why upon changing GRid Pages the procedure gets called again.
NOTE: I have bound the GridView using SqlDataSource.
Pankaj Chamria,
Software Programmer.
|
|
|
|
|
U have to use the Gridview_paging Event..in this u have find the currentindex of the Gridview give this index to the newIndex of the Gridview...then bind the Grid again.
|
|
|
|
|
But how will this not call the stored procedure again.??
Pankaj Chamria,
Software Programmer.
|
|
|
|
|
u have to creat function that binds the grid
ie BindGrid();
call it on load;
then creat gridview_pageindexchanging
and put in it
{
gv.PageIndex=e.New index;
BindGrid();
}
|
|
|
|
|
Pankaj C wrote: If my procedure at the first place did give the GridView all the 100 rows then why upon changing GRid Pages the procedure gets called again.
You should take a good book and learn how web pages works.
HTTP is a stateless protocol. Gridview fetches all the rows when it is binded at the very first time. When you press the next button on pager, entire page will be posted to the server which removes all the values binded on the last page. So it will fetch all those data again and bind it to grid view, Pageindex will be checked then and it moves to the page specified.
This will make performance issues when you are working with large set of data's. So I prefer to do custom paging always, by fetching required number of rows from DB.
Hope this helps
|
|
|
|
|
Tks Navaneeth. Your answer nelped a lot. I will try and implement caching on my collection that binds to the GridView to improve performance. Although I guess custom paging is a much better option for huge no of records.
Pankaj Chamria,
Software Programmer.
|
|
|
|
|
Pankaj C wrote: Tks Navaneeth. Your answer nelped a lot.
Welcome.
Pankaj C wrote: I will try and implement caching on my collection that binds to the GridView to improve performance.
Instead of caching, you could go for custom paging. Caching might show weird results for users browsing site at same time.
|
|
|
|
|
I want to send an emai from my application to particular email id.
how can i do this?
Mogha Ritesh
|
|
|
|
|
|
dude...explore System.Net.Mail namespace
Koushik
|
|
|
|
|
|
Use this function
<br />
public bool SendMail(string to,string from,string subject,string cc,string bcc,string attachement,string body)<br />
{<br />
SmtpMail.SmtpServer=ConfigurationSettings.AppSettings["SmtpServer"].ToString();<br />
MailMessage objmail = new MailMessage(); <br />
<br />
<br />
objmail.BodyFormat = MailFormat.Html; <br />
objmail.To = to;<br />
objmail.From =from;<br />
objmail.Subject = subject; <br />
objmail.Body = body;<br />
if(cc!="")<br />
{<br />
objmail.Cc = cc;<br />
}<br />
if(bcc!="")<br />
{<br />
objmail.Bcc = bcc;<br />
}<br />
if(attachement!="")<br />
{<br />
objmail.Attachments.Add(new MailAttachment(attachement));<br />
}<br />
try<br />
{<br />
SmtpMail.Send(objmail);<br />
return true;<br />
}<br />
catch<br />
{ <br />
return false;<br />
}<br />
<br />
<br />
}<br />
Keep Smiling
|
|
|
|
|
I want to prevent user from type any numbers in the text box .. in another meaning i want nothing to happen when he clicks any number in the keyboard ..
how ? plz help ..
|
|
|
|
|
Have you tried Compare validator??
Sucess need one master Stroke
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
This is the reverse of a common question, so search for the javascript to only allow numbers, and reverse it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I am creating a project on Shopping Cart.Though I got lot of things from Google only,I want if any body knows some specific site/sites which helps to create project from starting level or any Webcast related to this?
Any kind of help is appreciated.
Regards,
Montu
Hello Everybody
|
|
|
|
|
i think there is no such specific sites which help you in making shopping cart site. its all depend on ur need of the project.u need to help urs by urself.
Sucess need one Master Stroke
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
Hi All,
I am creating a project on Shopping Cart.Though I got lot of things from Google only,I want if any body knows some specific site/sites which helps to create project from starting level or any Webcast related to this?
Any kind of help is appreciated.
Regards,
Montu
Hello There
|
|
|
|
|
|
A shopping cart is a pretty basic project, really, any ASP.NET site or book should give you all the info you'd need.
Please don't ask twice.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi there,
i got datatable dt to which i fetched value from database. i have a column in the table "status" which the values are stored as 0 for active and 1 for inactive in the database. my problem is i want to display the value as active or inactive in datagrid. but i dnt know how to do it after getting the values to a datatable.please can anyone help
|
|
|
|
|
Hi!
You can do this thing directly into SQL query which you are using for retrieving Data from Database.
select case when status=0 then '<font style="color:Green">Active</font>' else '<font style=color:Red>Deactive</font>' end as status from Table
Try this.
Keep Smiling
|
|
|
|