|
I want to import the data of a grid view to XL sheet...I used the folllowing code
GridView1.AllowPaging = False
Call btndisplay_Click(sender, e)
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
Me.GridView1.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
GridView1.AllowPaging = True
Call btndisplay_Click(sender, e)
The code works but when i have 0 in the begning (like 00ABCD),it dosent take the 0 and tkes ABCD only..
How can i format the column to text (in code behind) so that it would accept zero in the begning
Regards
|
|
|
|
|
|
anujbanka1784 wrote: pls help fresher..
Please help yourself by searching the forum. This question is asked daily.
|
|
|
|
|
|
You do not have the required attributes to be a programmer, choose another career path.
|
|
|
|
|
|
Looks to me as if you are a bit hurt. Cheer up
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Hi!! I have Binded list of files from a directory into datagrid. i have also added an hyperlink to the datagrid so that the particular file will open after clicking it. But when i do so i get an error message as follows..
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /TestMain/Needle brg and oil seal pressing.pdf
THE PAGE_LOAD CODE IS
protected void Page_Load(object sender, EventArgs e)
{
try
{
//String[] f = Directory.GetFiles("c:/gearfactory");
dir = new DirectoryInfo(Server.MapPath("~/gearfactory"));
articleList.DataSource = dir.GetFiles("*.pdf");
//articleList.DataSource = f;
articleList.DataBind();
}
catch (Exception ex)
{
Response.Write("Error :-" + ex);
}
}
THE DATAGRID SOURCE CODE IS
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name"
HeaderText="File Name" />
<asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
ItemStyle-HorizontalAlign="Center" DataFormatString="{0 }" />
<asp:BoundColumn DataField="Length" HeaderText="File Size"
ItemStyle-HorizontalAlign="Right"
DataFormatString="{0:#,### bytes}" />
</Columns>
</asp:DataGrid>
Can some one help me with this. Thank you in advance.
Ashish.
|
|
|
|
|
Hi friends
I need to generate automatic keywords while you register yahoo and gmail ie. we enter one by one first name ,address etc., at last a code shown in a box that is automatic generate code. I want to know how to generate the code using asp.net. Is it possible??
Hope yours reply.
Every Successful Person Have A Painful Story
|
|
|
|
|
Guvera wrote: I need to generate automatic keywords while you register yahoo and gmail ie. we enter one by one first name ,address etc., at last a code shown in a box that is automatic generate code. I want to know how to generate the code using asp.net. Is it possible??
You are asking for CAPTCHA Image. There are many good article available in Codeproject.
Please have a look,
CAPTCHA Image[^]
and
A CAPTCHA Server Control for ASP.NET[^]
|
|
|
|
|
Hi,
What is BizTalkServer?
Where we use it?
What is the special feature ?
Please share your ideas..
----
Glossy**
|
|
|
|
|
Glossy wrote: Hi,
What is BizTalkServer?
Where we use it?
What is the special feature ?
Here is Two Best Link For you
1. Ref1[^]
and
2.Ref2[^]
|
|
|
|
|
Hai Friends,
I put a label in master page enabled page.I want to get the id of that label in another page where the second page is not a masterpage enabled page.How i get the label control id in the second page.Please help me.
|
|
|
|
|
You can't, if it doesn't use the master page, then the masterpage does not exist for that page lifecycle. You need to store it in the session or something.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
please send some code how to convert the session to control.
|
|
|
|
|
string labelid =(Label)session("name");
umerumerumer
|
|
|
|
|
I am developing website using C# with ASP.net.
one page I am inserting data into hashtable after reach 1000(>1000),Add it into Array list than Insert into Database...here sometimes saying Exception like
Item has already been added. Key in dictionary: '12' Key being added: '12'
...Please help me with this.....How to avoid this Eception...
and I am using following code..
public static Hashtable ht = new Hashtable();
public string Crid="";
Crid = ht.Count.ToString();
string[] st = new string[4];
st[0] = Crid;
st[1] = "5654546456";
st[2] = "0";
st[3] = "1";
if (ht.Count<1000)
{
ht.Add(ht.Count, st);
}
else
{
ArrayList list = new ArrayList();
foreach (int key in ht.Keys)
{
list.Add(ht[key]);
}
ht.Clear();
ht = new Hashtable();
ht.Add(ht.Count, st);
for (int j = 0; j < list.Count; j++)
{
//here Inserting data into Database
}
}
Raaj
|
|
|
|
|
Isn't it obvious ? Don't add a key that is already there. So, check if the key exists and if it does, decide if you want to change the value that's there, or leave it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you are using a static variable in a web application, you have to synchronise all access to it. The reason for the error is that two users are adding items at the same time. You are lucky that you got such a descriptive error message, you could just as well have corrupted the HashTable and got some internal error in the HashTable code...
Use a List instead of a HashTable. You are only using the key of the HashTable as an index anyway.
Instead of copying the items one by one into a new collection, just keep them in the collection where they are.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello All,
Using asp.net and c# 2005 Retreiving data from a View on SqlServer 2005.
While retreiving less number of records its working fine and showing data,while retreiving more records like millions billions of data then not getting data showing timeout exception, Can you give me any solution for this to retreive whole data fastly
Thanks in advance
Gopi
Gopi
|
|
|
|
|
What sort of retard would ask for millions of records and expect it to be responsive ? What sort of UI would you expect to use to show millions of records ?
Fix your SQL so it only returns the data you want to show and make your page size sensible. Then it will work fine.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
In sql query is running fine,While fetching less number of records working fine in code,where as taking time to fetch more than one lakh records,
|
|
|
|
|
I understood that. Like I said, to try to display 100,000 records, is plain retarded. You're not showing that many records in one page, are you ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am not showing that many records in a page,
I have a view with more joins and unions,In that records I have more than 100,000 records,Now from this view I am filling the dropdowns based on some conditions we are filtering,So for that filtering it may doing sequential search in that view.while doing this I am getting timeout exception
This is the case am getting TIME OUT EXCEPTION.
Thanks in advance
Gopi
gopi
|
|
|
|
|
Hai all
I am using vs2005 web application and using infragistics controls .
I need to set scrollbar for datepicker year and month dropdown ,how to set
it. Can anyone help me .
|
|
|
|