/*利用流技术,将控件中的数据通过文件流导入到excel中*/
private void toolStripbtnSave_Click(object sender, EventArgs e)
{//将数据表中的数据保存到excel文件中
SaveFileDialog dlg = new SaveFileDialog();
dlg.Filter = "txt files (*.txt)|*.txt|excel files (*.xls)|*.xls|All files (*.*)|*.*";
dlg.FilterIndex = 2;
dlg.Title = "存盘设置";
dlg.RestoreDirectory = true;
dlg.CreatePrompt = true;
//dlg.ShowDialog();
Stream myStream;
if (dlg.ShowDialog() == DialogResult.OK)
{
if ((myStream = dlg.OpenFile()) != null)
{
if (dlg.FilterIndex == 2)
{
//保存数据
StreamWriter sw &#