15,895,192 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Ankit 71 (Top 8 by date)
Ankit 71
9-Oct-14 1:48am
View
after download it shows an error ,, i dont think so that code is wrong
Ankit 71
9-Oct-14 1:43am
View
This is code of CS Page
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
int fileId = Convert.ToInt32(gvUploadedFiles.DataKeys[gvrow.RowIndex].Value.ToString());
using (SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
{
using (SqlCommand sqlCmd = new SqlCommand())
{
sqlCmd.CommandText = "SELECT * FROM song WHERE id=@id";
sqlCmd.Parameters.AddWithValue("@id", fileId);
sqlCmd.Connection = sqlConn;
sqlConn.Open();
SqlDataReader dr = sqlCmd.ExecuteReader();
if (dr.Read())
{
string fileName = dr["songname"].ToString();
string fileLength = dr["FileSize"].ToString();
string filePath = dr["FilePath"].ToString();
if (File.Exists(filePath))
{
using (ZipFile zip = new ZipFile())
{
zip.AlternateEncodingUsage = ZipOption.AsNecessary;
zip.AddDirectoryByName("Top Songs");
foreach (GridViewRow row in gvUploadedFiles.Rows)
{
if ((row.FindControl("chkSelect") as CheckBox).Checked)
{
string lblfilepath = (row.FindControl("lblFilePath") as Label).Text;
zip.AddFile(lblfilepath, "Top Songs");
}
else
{
Response.Clear();
Response.BufferOutput = false;
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Length", fileLength);
Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
Response.TransmitFile(filePath);
Response.Flush();
}
}
Response.Clear();
Response.BufferOutput = false;
string zipName = String.Format("Top Songs - {0}.zip", fileName);
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "attachment; filename=" + zipName);
zip.Save(Response.OutputStream);
Response.End();
}
}
}
}
}
Ankit 71
9-Oct-14 1:36am
View
This is HTML code
<div style="font-family: Arial, Helvetica, sans-serif; font-size: x-large; margin-left:10px;">
Top 30
<asp:Label ID="lbtitle" runat="server" Text=""> Songs
</div><br />
<div class="song">
<asp:GridView ID="gvUploadedFiles" runat="server" AutoGenerateColumns="False"
DataKeyNames="id" RowStyle-BackColor="#A1DCF2" Font-Names = "Arial" Font-Size = "10pt"
HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White"
BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3" Height="75px" AllowPaging="True"
onpageindexchanging="OnPaging">
<HeaderStyle Font-Bold="true" BackColor="#ff6600" BorderColor="#f5f5f5"
ForeColor="White" />
<columns>
<asp:BoundField DataField="songname" HeaderText="FileName"
ControlStyle-Width="250" />
<asp:TemplateField>
<itemtemplate>
<object type="application/x-shockwave-flash" data="dewplayer-vol.swf?mp3=AdminPanel/SongUploads/<%# Eval("songname") %>"
width="240" height="20" id="dewplayer">
<param name="wmode" value="transparent" />
<param name="movie" value="dewplayer-vol.swf?mp3=AdminPanel/SongUploads/<%# Eval("songname") %>"/>
<%--<asp:TemplateField>
<itemtemplate>
<div style="padding: 4px 10px 10px 10px;">
<asp:CheckBox ID="chkSelect" runat="server" style="float:none; Height:15px; Width:15px;"/>
<asp:Label ID="lblFilePath" runat="server" Text='<%# Eval("FilePath") %>' Visible="false">
</div>
--%>
<asp:TemplateField>
<itemtemplate>
<asp:LinkButton ID="lnkDownloadMe" runat="server" Text="Download"
OnClick="lnkDownloadMe_Click" />
<footerstyle backcolor="White" forecolor="#000066">
<HeaderStyle BackColor="#006699" ForeColor="White" Font-Bold="True"></HeaderStyle>
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<rowstyle forecolor="#000066">
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<sortedascendingcellstyle backcolor="#F1F1F1">
<sortedascendingheaderstyle backcolor="#007DBB">
<sorteddescendingcellstyle backcolor="#CAC9C9">
<sorteddescendingheaderstyle backcolor="#00547E">
Ankit 71
11-Jul-14 7:10am
View
unhandled exception has occured in your application. if you click Continue,the application will ignore this error and attempt to continue. If you click quit . the application will clise immidiately
Load report failed.
Ankit 71
8-May-14 3:36am
View
my code is: SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["sst"].ToString());
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from mastertable ", con);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
con.Close();
now i show the record on that field that i have selected,, but all the users that lies in that table not the login user.
Ankit 71
8-May-14 3:33am
View
in sql
Ankit 71
23-Apr-14 4:13am
View
I Tried it but it shows an error ,, like this..
64-bit runtime
WPF viewer
Enhanced embedded report designer
Support for exporting to XLSX
Ankit 71
19-Apr-14 0:45am
View
sir, i have used ur solution. now when i write ur code on my project it shows an error response.write with red line on the bottom.
and also shows error on "<script language="'javascript.
the error is Too many character in character literel.
Show More