把datatable里的数据转换成xml格式的字符串
string GetXmlByDataTable()
{
string xmlstr;
string sql = "select top 10 * from BasicInfo";
DataTable dt = idb.ReturnDataTable(sql);
dt.TableName = "tbname";
if (dt.Rows.Count>0)
{
System.IO.StringWriter writer = new System.IO.StringWriter();
dt.WriteXml(writer);
xmlstr = writer.ToString();
}
return xmlstr;
}
相关文档:
首先要有一个简易的服务器,建立一个站点,然后站点下存放
1:crossdomain.xml 这个是跨与域策略文件,用于指定域通过Flash
Player访问本域的资源(如果服务器在本机就没有这个必要)但是远程的话就要(建议要)
文件内容:
<cross-domain-policy>
<allow-access-from domain="*" /> ......
方法一:
采取通用的base64编码方式,取时解码存时加码。
毛老师提供了完整的编码代码,且效率很高。
unit Base64;
interface
uses SysUtils, Classes;
type
{$IFDEF UNICODE}
Base64String = AnsiString;
{$ELSE}
Base64String = strin ......
如果对界面美观程序比较高,手写代码是不可避免的。
但如果做的是一些像只是为了显示、控制之类的程序,可能更快的把程序捣鼓出来就好了。
wxwidgets有这样的一个功能,就是能用xml写成界面就能显示
编辑xrc的工具是wxformbuilder,开源免费的,也足够用了,我一开始没找到怎么生成xrc,后来某次偶然看到了下面....原来有c ......
class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFi ......
Integration with the XML Data Type
With the introduction of the XML data type, we wanted to also give FOR XML the ability to generate an instance of XML directly (more precisely, it generates a single row, single column rowset where the cell contains the XML data type instance).
Because of the bac ......