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
toanhoi bui
NA
70
207.1k
Error load audio from sql to Datagridview
Apr 1 2011 9:11 AM
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"
Reply
Answers (
2
)
How to put multiple events code in a single event
Re-bind datagrid when window is closed