473,787 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to retrive mp3 file from data base

1 New Member
hai all...,
i used to store my mp3 file into database by
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt3.aspx.cs" Inherits="Defau lt3" %>
<%@ import Namespace="Syst em.IO" %>
<%@ import Namespace="Syst em.Data.SqlClie nt" %>
<%@ import Namespace="Syst em.Drawing.Imag ing" %>
<%@ import Namespace="Syst em.Drawing" %>
<%@ import Namespace="Syst em.Data" %>
<%@ import Namespace="Syst em.Web.UI.WebCo ntrols" %>
<script runat="server">

void upload(Object s, EventArgs e)
{
// create a byte[] from the input file

int imagelen = songUpload.Post edFile.ContentL ength;
byte[] pic = new byte[imagelen];
songUpload.Post edFile.InputStr eam.Read (pic, 0, imagelen);


//select * from SongDetails

//string connectionStrin g = "connection string";

using (SqlConnection dataConnection = new SqlConnection(" Data Source=192.168. 0.100;Initial Catalog=master; User ID=sa;Password= ;"))
{
using (SqlCommand dataCommand = dataConnection. CreateCommand() )

{

dataConnection. Open();

SqlCommand cmd = new SqlCommand ("INSERT INTO SongDetails" + "(SongTitle , SongArtist, Song) VALUES (@SongTitle, @SongArtist, @Song)", dataConnection) ;

cmd.Parameters. Add("@SongTitle ", txtSongTitle.Te xt);
cmd.Parameters. Add("@SongArtis t", txtSongArtist.T ext);
cmd.Parameters. Add("@Song",pic );
cmd.ExecuteNonQ uery();
Label1.Text =("updated record");
dataConnection. Close();
txtSongTitle.Te xt = "";
txtSongArtist.T ext = "";
}
}
}

</script>
<html>
<head>
<title>HurdLeg. com :: Administrator - Upload</title>
</head>
<body>
<form id="Form1" enctype="multip art/form-data" runat="server">
<p align="Left">
<font size="5"><i>mp3 file into Database</i></font>
</p>
<p><font size="3"></font></p>
<p><font size="3"></font></p>
<p><font size="3"></font></p>
<p>
<font size="3">Title: </font>
<asp:TextBox id="txtSongTitl e" runat="server"> </asp:TextBox>
</p>
<p>
<font size="3">Artist :</font>
<asp:TextBox id="txtSongArti st" runat="server"> </asp:TextBox>
</p>

<p>
<font size="3">File:</font>&nbsp;&nbs p;&nbsp;
<asp:FileUplo ad id="songUpload " runat="server"> </asp:FileUpload>
</p>
<p>
<input id="btnUpload" type="button" value="upload" runat="server" onserverclick=" upload" />
<asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 15px; position: absolute;
top: 260px" Width="205px"></asp:Label>
</p>
</form>
</body>
</html>


but iam not able to retrive my mp3 file from database. so please any body can help me
by
varaprasad
Jul 23 '07 #1
0 1541

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1665
by: Terry | last post by:
Any .dll or COM+ for .Net can help me retrive data from a Access file? The table contain several columns and the last one is a container which I store Article; because each article is a little bit huge, so when I store it, it ask me if I want to pack it (the article) into a object then I click 'Yes'. But now I need to retrive data from the file and show it by datagrid, and now I don't know what kind of data type it is (when I click it, it...
1
2603
by: Santosh | last post by:
Dear All i am writting a code sending mail with attachement. i am writting code for sending mail in one page and code for attaching a file in the next page. aftet attaching a file i am taking name of that file from attaching file page to email page through in session file .i am giving a facility of attaching five files to user . and i am taking names of both files in session variables but user attach less than five five
0
1276
by: avishekb | last post by:
can anyone suggest me how to retrive data from a xml file using c/c++. for example: <schema> <applt to>portno</applyto> <type>int</type> <value>8080</value> </schema> i want to retrive the value 8080 from the file and assign it to portno,so that when i am using portno in my program it will be replaced by 8080.
8
2534
by: asenthil | last post by:
Hai, i'm having a string in a specific field of a database... now i want to retrive that string from the database and i have to write that string into a xml file.... retriving is not a problem for me... but how can i write that string to a xml file....
9
2860
by: asenthil | last post by:
Hai to all,, i had to tried to retrive and write a single row to a file from the database.. But dont know to write all the retrived rows to a file from the database.. how to do that... here are my codings for writing a single row to a file...
1
2111
by: srinivasdevakumar | last post by:
MY doubt is how to retrive multiple rows from data base on one condition by using JSP. please tell me
3
1970
by: =?Utf-8?B?UGV0ZXIgSiwgU2Nhbmlh?= | last post by:
Hello I'm looking for an solution about how to retrive data from an client side located Excel document by using an ASP.Net application. I don't want to upload the file to the server. I just want to get the data and persist it in an database after that some business validation have been done. Does anyone have any idea?
1
3380
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title>
1
1649
by: ganesh22 | last post by:
Hi, Here the below code is for dynamically creating textboxs, its creating fine but after user enters some values in textboxs how can i retrive that values? using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10169
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.