|
Hi,
I use a gridview with checkbox & emailid for sending newsletter, which bind with sqlserver 2000 table, that contains more than 2000 records, so when page load it takes so much time. Please send me better solution for sending newsletter.
|
|
|
|
|
It's better if you load the database in the Cache when application starts and then use the cached database.It'll help in better performance
|
|
|
|
|
I believe you are using paging feature for displaying 2000 rows in grid view.
Transfer 2000 rows across the network will take long time and application becomes very slow.
Instead of that you can write a stored procedure, which will fetch only those rows which are supposed to display on a particular page ( suppose if page size is 20 and User clicks on 3rd page your stored procedure should fetch the rows from 41 to 60 records)
you can find variety of stored procedures on the net for doing this, just Google.
Satish
|
|
|
|
|
bind with SqlDataSource, much faster than doing things manually
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hi i want to populate gridview with list of files within a directory which is a part of my project. and when user clicks on any file name then that file should open. I am using ASP.net with C#.
i have pupulated the grid view with list of files but when i click on the file name it gives an error.
Can anybody help me out of this.
thanks in advance.
modified on Friday, February 20, 2009 5:23 AM
|
|
|
|
|
Make the gridview field that the file name appears as a template field and try to get the path first.If u r storing all the files in one palce or folder means it is easy to get the path.First get the cell value and then append the path,here i am giving one eg it may help u(U have only the reference of the file in the dataGrid)
here i am getting the cell value from the grid and appending with the path and then giving to play in a player
aspx page
]]>
<title>Untitled Page
window.moveTo(0, 0);
window.resizeTo(screen.width, screen.height)
function PlayIt(a)
{
var what='C:\\rakesh\\Music\\AnanthaBhadram\\Music\\'+a;
document.getElementById('music').innerHTML='<object width="300px" height="60px" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="url" value="'+what+'" />'
+'<param name="uiMode" value="full" />'
+'<param name="autoStart" value="true" />'
+'<param name="loop" value="true" />'
+'<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" showcontrols="true" uimode="full" width="300px" height="60px" src="'+what+'" autostart="true" loop="true">'+'</embed></object>';
return false;
}
function right(e)
{
if (navigator.appName == 'Netscape' &&(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
{
alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
function abc(a)
{
var what="C:\\rakesh\\Music\\AnanthaBhadram\\"+a;
alert(what);
}
<object height="55" width="249" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" style="z-index: 100; left: 302px; position: absolute; top: 98px">
<param name="URL" value="" />
<param name="rate" value="1" />
<param name="balance" value="0" />
<param name="currentPosition" value="0" />
<param name="defaultFrame" value="" />
<param name="playCount" value="1" />
<param name="autoStart" value="-1" />
<param name="currentMarker" value="0" />
<param name="invokeURLs" value="-1" />
<param name="baseURL" value="" />
<param name="volume" value="50" />
<param name="mute" value="0" />
<param name="uiMode" value="full" />
<param name="stretchToFit" value="-1" />
<param name="windowlessVideo" value="-1" />
<param name="enabled" value="-1" />
<param name="enableContextMenu" value="-1" />
<param name="fullScreen" value="0" />
<param name="SAMIStyle" value="" />
<param name="SAMILang" value="" />
<param name="SAMIFilename" value="" />
<param name="captioningID" value="" />
<param name="enableErrorDialogs" value="-1" />
<param name="_cx" value="6588" />
<param name="_cy" value="1455" />
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" datasourceid="SqlDataSource1" onrowdatabound="GridView1_RowDataBound" xmlns:asp="#unknown">
Style="z-index: 102; left: 305px; position: absolute; top: 206px">
<columns> <asp:templatefield headertext="No" insertvisible="False" sortexpression="No">
<edititemtemplate>
<asp:label id="Label1" runat="server" text="<%# Eval(" no=") %>">
<itemtemplate>
<asp:label id="Label1" runat="server" text="<%# Eval(" no=") %>">
<asp:templatefield headertext="Music_Path" sortexpression="Music_Path">
<itemtemplate>
<asp:linkbutton id="LinkButton2" runat="server" text="<%# Eval(" music_path=") %>" commandargument="<%# Eval(">LinkButton
<asp:templatefield headertext="Name" sortexpression="Name">
<itemtemplate>
<asp:linkbutton id="LinkButton1" runat="server" text="<%# Bind(" name=") %>" commandargument="<%# Eval(">
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="Data Source=ONAM;Initial Catalog=Rakesh;User ID=sa" xmlns:asp="#unknown">
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [No], [Music_Path], [Name] FROM [Music]">
cs file
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView1_RowDataBound(object sender,GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1");
l.Attributes.Add("onclick", "return PlayIt('" + l.CommandArgument + "') " );
}
}
}
modified on Friday, February 20, 2009 5:55 AM
|
|
|
|
|
Hi...
First I would like to know whether you need to get the files from the directory in the local system only or you would like to upload the files as well.
If you want to get the files from the directory we can use Directory.GetFiles() method.
GO through the following code.
GridView1.DataSource = Directory.GetFiles("c:\\Tempu\\Upload", "*.doc");
GridView1.DataBind();
Please let me know if it serves your question.
Regards
Raj.
|
|
|
|
|
i am developing an application in aSP.net using C#, in which i want to store the files path into access database and then i want to open this file when user clicks on the particular link. can anyone help me out of this. it's really very urgent.
remember i am using ASP.net with C#.
Thanks in advance.
|
|
|
|
|
urgent is a very Strong word, you mostly use it when tell someone that works for you, but unfortunately we dont work for you. Stop using such words in then Forum.
In your Question you have this
i am developing an application in aSP.net using C#, in which i want to store the files path into access database
I wanted to Answer you , but when i saw this again
then i want to open this file when user clicks on the particular link
You consused me there. Well i dont know what you are doing but you can save the File path in the Access database like any other record but by keeping in mind that it can be long text. but mybe you can explin clearly what you want to achieve.
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
Hi,
First you should increase your data type length bcoz file path may be very lenthy and then u bind file like other field, and check ur file is having correct path with file name when it is inserted.
|
|
|
|
|
As u said, when user click on the link it wont open,remember only the path is there in database .U must store the file in database,then only it will happen. And if u r storing the full path,then it is easy to get the path as cell value.Then u can open it.Make that field in gridview a template and try
modified on Friday, February 20, 2009 5:59 AM
|
|
|
|
|
Hi all,
I have developed my web site using Visual Studio 2008 and Framework 3.5, but the web server where I have registered contains only framwork 2.0, I have created the web site, that interacts with class lib to fetch and store data from and to database. So, my question is if i compail all this class lib in 2008 environemt and reconstruct a new site using the 2005, will all these class lib will work with the new site in 2005 and Framework 2008?
When i tried to convert the project to Framework 2.0 by Right clicking the Project->and changed the Frame work from 3.5 to 2.0 from the drop down, i got more erros with the reversing of List<> ASSEMBLY REFERENCE MISSING, some of the namespace missing errors. How to handel this suitaion and solve the issue with in less time
Else is there any good solution with this, insted of installing Framework 3.5 in server,
Please suggest me
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: When i tried to convert the project to Framework 2.0 by Right clicking the Project->and changed the Frame work from 3.5 to 2.0 from the drop down, i got more erros with the reversing of List<> ASSEMBLY REFERENCE MISSING, some of the namespace missing errors. How to handel this suitaion and solve the issue with in less time
Obviously, if you get those errors, the server will, too. The best thing is in future to establish your target framework before you start. For now, you need to fix those errors.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI
i am working on cms. i want to generate the menu and menuitem dynamically.
i mean that the sequence and page heirarchy is pass by administrator.
as per sequence and page heirarchy menu would be generate.
for example.
you first pass the about us page in menu. so the first menuitem is about us.
second and third onwards.
now suppose thier is page namely product which contain other page product description
then when i pass the heirarchy page should be generated as per the sequence and
heirarchy pass.
hope full favorable replay soon,
keyur
|
|
|
|
|
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
N!dh!
|
|
|
|
|
Hi,
Try setting the "EnableViewStateMac" property of the <%@Page...%> attribute to False.
Kind Regards
Pratik Shah
|
|
|
|
|
I have try this in web.config
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" EnableViewStateMac="false"/>
it didn't work.
i have tried this on perticular page also but it didn't.
N!dh!
|
|
|
|
|
Hi Every body...,
i have problem with CSV.How to Coverting data in a table to CSV file.
(i am using Sql2005 and Vs2005 asp.net ajax,C#)
Please Help Me.........,
|
|
|
|
|
The fact that you mention AJAX makes me worry that you don't understand any of hte things you are using.
you get your data from SQL Server, and you write it to a file, with a comma between each value and a new line between each line. It's really that simple. Which bit are you stuck on ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
1) Using a datareader to directly read the data and write the file yourself
2) Using a DataTable/DataAdapter combination to load the data and write the file yourself
3) Using Sql's built-in export feature to write the file
4) Using Sql's ability to output Xml and using an XSL Transformation to write the file
There, that should give you some google fodder.
Ive probably missed a few.
|
|
|
|
|
Hi,
I m trying to retrieve address book of hotmail using the api.
I m getting error 404.
Can any one help me out with this?
here is my class file
public class LiveExtract : IMailContactExtract
{
#region IMailContactExtract Members
public bool Extract( NetworkCredential credential, out MailContactList list )
{
list = new MailContactList();
bool result = false;
try
{
TicketAcquirer ticketAcquirer = new TicketAcquirer();
string ticket = ticketAcquirer.GetTicket( credential );
if ( string.IsNullOrEmpty( ticket ) )
{
return false;
}
UriBuilder urib = new UriBuilder();
urib.Scheme = "HTTPS";
urib.Path = string.Format( "/{0}/LiveContacts", credential.UserName );
urib.Host = "cumulus.services.live.com";
//urib.Host = "hotmail.com";
//urib.Host = "login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1235053953&rver=5.5.4177.0&wp=MBI&wreply=http://mail.live.com/default.aspx&lc=1033&id=64855&mkt=en-US";
urib.Port = 443;
HttpWebRequest request = ( HttpWebRequest ) WebRequest.Create( urib.Uri );
string authHeader = string.Format( "WLID1.0 t=\"{0}\"", ticket );
request.Headers.Add( "Authorization", authHeader );
WebResponse response = request.GetResponse();
if ( response.ContentLength != 0 )
{
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load( response.GetResponseStream() );
XmlNodeList contacts = xmlDocument.SelectNodes( "/LiveContacts/Contacts/Contact" );
foreach ( XmlNode node in contacts )
{
//XmlNode firstName = node.SelectSingleNode( "Profiles/Personal/FirstName" );
//XmlNode lastName = node.SelectSingleNode( "Profiles/Personal/LastName" );
//XmlNode firstMail = node.SelectSingleNode( "Emails/Email/Address" );
//MailContact mailContact = new MailContact();
//mailContact.Name = string.Format( "{0} {1}", firstName.InnerText, lastName.InnerText );
//mailContact.Email = firstMail.InnerText;
//list.Add( mailContact );
string firstName = node.SelectSingleNode("Profiles/Personal/FirstName") != null ? node.SelectSingleNode("Profiles/Personal/FirstName").InnerText : null;
string lastName = node.SelectSingleNode("Profiles/Personal/LastName") != null ? node.SelectSingleNode("Profiles/Personal/LastName").InnerText : null;
string email = node.SelectSingleNode("Emails/Email/Address") != null ? node.SelectSingleNode("Emails/Email/Address").InnerText : null;
if (!string.IsNullOrEmpty(email))
{
MailContact mailContact = new MailContact();
mailContact.Name = string.Format("{0} {1}", firstName, lastName);
mailContact.Email = email;
list.Add(mailContact);
}
}
}
result = true;
}
catch
{
}
return result;
}
#endregion
}
Vijay V.
Yash Softech
|
|
|
|
|
hi i am using following function to get date..
gmdtrdate.Text = DateTime.Today.Date.ToShortDateString();
it is returning me 2/2/2008
can i get it like 02/02/2008 or i will have to attach 0 manually???
umerumerumer
|
|
|
|
|
use
Response.Write(String.Format("{0:MM/dd/yyyy}", DateTime.Now()));
The miracle is this--the more we share, the more we have.
|
|
|
|
|
i dont want to hard code these values i just want to pick according to the regional date settings... if american then MM/dd/yyyy if british then dd/MM/yyyy
....
umerumerumer
|
|
|
|
|
I checked on mine, its returning 21-02-2009. And It depends on client regional settings.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|