I using C# to write a project to load file audio which formats .wav from SQL to DataGridView. But it was error .Can you help me,please ?
SqlConnection con = new SqlConnection("Data Source=CHANGEME1;AttachDbFilename=D:\\Code C#\\SimpleRec\\DataBase_Audio
SqlCommand com = new SqlCommand("select * from tbAudio where MaThe =136020379226", con);
con.Open();
DataTable dt = new DataTable();
SqlDataReader dr = com.ExecuteReader();
dt.Load(dr);
if (dt.Rows.Count == 1)
{
dataGridView1.DataSource = dt;
}
dr.Close();
con.Close();
byte[] stream = (byte[])dt.Rows[0][0];
File.WriteAllBytes("D:\\news.wma", stream);
Error is "The following exception occurred in the DataGridview"
Error load audio from sql to Datagridview
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Soft CornerRank #1,221 · 1.5K reputationPosted Apr 1, 2011, 8:35 AM EDT
Why you are loading audio file into DataGrid?? Is your audio file having Some tabular Data to Show on Grid??
so, instead of loading into grid , load to media control.
toanhoi bui70 reputationPosted Apr 1, 2011, 8:57 AM EDT