我在aspnet部署网站后,有一个功能是导出Excel,很多服务器都没有问题,但是有些服务器会跳出Attempted to read or write protected memory, THis is often an indication that other memory is .......的错误信息,请教各位高手,这是什么原因,有什么解决方法,谢谢!
解决方案 »
- A页面弹出窗口(B页面),如何将B页面的TextBox的值传递到A页面,并执行A页面按钮Click事件并输出..
- Asp.net调用Word 时,Word进程释放内存的问题
- 高分求解,GridView列表中的值如果没有占满是时,怎样让空白处显示空行?
- 请教iframe刷新问题
- 关于快速登录邮箱
- 江湖救急 .net调用MYSQL????????? 在线等
- 这样的一段代码在asp.net里该怎么写?
- C++写的dll,C# ASP.NET调用,放在Windows 2003就不好用了,神阿,救救我吧
- 一个关于在线调查的脚本的问题,解决不了,大家帮帮忙呀!!
- 格式转化
- SQL 2005
- ModalPopupExtender 无法覆盖 DragPanelExtender
-- ======================================================
T-SQL代码:
EXEC master..xp_cmdshell 'bcp 库名.dbo.表名out c:\Temp.xls -c -q -S"servername" -U"sa" -P""'
参数:S 是SQL服务器名;U是用户;P是密码
说明:还可以导出文本文件等多种格式
实例:EXEC master..xp_cmdshell 'bcp saletesttmp.dbo.CusAccount out c:\temp1.xls -c -q -S"pmserver" -U"sa" -P"sa"'
EXEC master..xp_cmdshell 'bcp "SELECT au_fname, au_lname FROM pubs..authors ORDER BY au_lname" queryout C:\ authors.xls -c -Sservername -Usa -Ppassword'
在VB6中应用ADO导出EXCEL文件代码:
Dim cn As New ADODB.Connection
cn.open "Driver={SQL Server};Server=WEBSVR;DataBase=WebMis;UID=sa;WD=123;"
cn.execute "master..xp_cmdshell 'bcp "SELECT col1, col2 FROM 库名.dbo.表名" queryout E:\DT.xls -c -Sservername -Usa -Ppassword'"
------------------------------------------------------------------------------------------------4、在SQL SERVER里往Excel插入数据:
-- ======================================================
insert into OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\Temp.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...table1 (A1,A2,A3) values (1,2,3)T-SQL代码:
INSERT INTO
OPENDATASOURCE('Microsoft.JET.OLEDB.4.0',
'Extended Properties=Excel 8.0;Data source=C:\training\inventur.xls')...[Filiale1$]
(bestand, produkt) VALUES (20, 'Test')