TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rini
1.5k
204
31.5k
export to xcel
Mar 31 2014 1:02 AM
Dear sir,
in my program,i have a button download..
when i click the buttondownload i want to downloadthe details and also want the count of the details.
when i click the download button..
download is done.but didn't display the count
my code is
if (DropDownList1.SelectedIndex == 1)
{
if (TextBox1.Text != string.Empty)
{
dec2DivId = TextBox1.Text;
// gridPinSearch();
MobileSp spmobile = new MobileSp();
DataTable dtblc = new DataTable();
dtblc = spmobile.pinCodeSearch(dec2DivId);
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=PinnumberSearch.csv");
Response.Charset = "";
Response.ContentType = "application/text";
StringBuilder sb = new StringBuilder();
for (int k = 0; k < dtblc.Columns.Count; k++)
{
sb.Append(dtblc.Columns[k].ColumnName + ',');
}
//append new line
sb.Append("\r\n");
txtCount.Text = dtblc.Rows.Count.ToString();
for (int i = 0; i < dtblc.Rows.Count; i++)
{
for (int k = 0; k < dtblc.Columns.Count; k++)
{
sb.Append(dtblc.Rows[i][k].ToString().Replace(",", ";") + ',');
}
//append new line
sb.Append("\r\n");
}
Response.Output.Write(sb.ToString());
Response.Flush();
Response.End();
}
}
Reply
Answers (
3
)
error converting datatype varchar to float
Reading XmlDocument element values in c#