473,800 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need reference for storing/retrieving .wav files in Sql2000

I can successfully write the binary data to an image data type, and
successfully retrieve it, but when I attempt to play the file in media player
after retrieving it, I get the file type isn't supported.

I must be losing something somewhere, but the byte lengths match up. Is
there some encoding I need to do.

Please take a look, and suggestions would be appreciated.
//Writing to sql from file

FileStream fs = new FileStream("xxx .wav", FileMode.Open, FileAccess.Read );

BinaryReader br = new BinaryReader(fs );
long size = fs.Length;

byte[] data = new byte[size];

br.Read(data,0, data.Length);

Database db = DatabaseFactory .CreateDatabase ("IvrRecordingD B");

DBCommandWrappe r cmd = db.GetStoredPro cCommandWrapper ("uspInsertReco rding");

cmd.AddInParame ter("@recording ", DbType.Binary, data);

db.ExecuteNonQu ery(cmd);

//Retrieving data and writing to file
byte[] data = new byte[0];

Database db = DatabaseFactory .CreateDatabase ("IvrRecordingD B");
DBCommandWrappe r cmd = db.GetStoredPro cCommandWrapper ("uspGetRecordi ng");

object audioBinary = db.ExecuteScala r(cmd);
data = (byte[])(audioBinary);

FileStream fs = new FileStream("new .wav",FileMode. CreateNew);
BinaryWriter bw = new BinaryWriter(fs );

bw.Write(data,0 ,data.Length);
bw.Close();
fs.Close();

Jan 13 '06 #1
0 1259

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3345
by: LizP | last post by:
Hi, guys - looking for a bit of help/advice on moving a database from SQL 7 to SQL 2000. We've a third party application which currently uses a SQL7 database. This database has a number of views which are owned by user INFORMATION_SCHEMA and are set as system tables. This user doesn't actually have a login on the SQL server. We've tried the following to recreate the database on SQL2000, but whatever we try, the views owned by...
2
297
by: Tan Tze Yong | last post by:
Dear all, I am tasked to write a program in C++ recently. However my knowledge in C++ is very limited. What happened is I am storing serveral vectors in a map. I need to retrieve the vector from the map and insert/remove items. I can figured out how to use a map and vector but I tried encapsulate the map in a class, I got problem retrieving the vector from it. The vector refused to store the items I add. It must be a silly mistake on my...
5
2148
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
4
2414
by: Lucas Tam | last post by:
Hi all, I'm currently storing a reference to the entire thread object in my application. However, I'm wondering if there is a smaller object I can point to such as an Integer ThreadID? If there is such a thing as a ThreadID, is there a method I can use to return the Thread object? Thanks.
1
5075
by: Byron | last post by:
Hi, I have(had) an old Win2k Server server with about 30 web site databases (SQL 2000) that just went under due to hardware problems. Thankfully, I have backups of all the databases plus the MDF and LDF files from the hard drive. I want to move all of these sites and their data to a newer server (Win2003) running SQL2000.
2
1589
by: Chris Thunell | last post by:
I have a sql database that stores documents (word and excel files) inside a field. These documents can be 10mb or larger in size. When running on my local network the files load very quickly, but on remote networks it runs quite slow. I'm wondering is there a way to measure how much data has been received from that field... and use a progress bar so the user doesn't think the application hasn't locked up? I'm not downloading multiple...
2
1269
by: Alejandro Kwiatkowski | last post by:
How I can do to store and retrieve files to/from a fields in a SQL Server table using .NET 2.0 Thanks you in advance Alejandro
2
5116
by: Gitesh | last post by:
Hi All, Could anyone help me out with storing PDFs into Oracle DB and then retrieving and displaying it back in the browser. Thanks in Advance, Gitesh
2
10755
by: WT | last post by:
Hello, Could we use 'Embedded resources' with resx files that contain text resources used in aspx pages with the syntaxe: Text="<%$ Resources:ResourcesMy,KEY1 %>" I tryed removing the App_GlobalResources folder, and after verifying thta my resources were correctly embedded in my dll, I get errors as if asp.net was
0
10507
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
10279
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
10036
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
9092
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...
0
6815
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();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2948
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.