同乙個worksheet根據資料特徵匯入到兩個表

2021-08-27 08:08:24 字數 1660 閱讀 1577

private void button1_click(object sender, eventargs e)

匯入條記錄。", tablename, importedcount)

, "匯入結果");

tablename = "tcmx";

importedcount = importdata(dtsource, tablename, path);

messagebox.show(

string.format("表匯入條記錄。", tablename, importedcount)

, "匯入結果");

}

/// /// 將提純過的記憶體表轉換成excel的陣列匯入到資料庫表

///

///

///

///

///

public static int importdata(datatable dtsource, string tablename, string configpath, int offsetcolumn = 1)

where 1=1",tablename),myvar.sqc.connectstring);

datatable dt = dtsource.copy();

if (myvar.bdcfg.onlycolumn > 0 && !string.isnullorempty(myvar.bdcfg.onlycolumnreg))

}myvar.bdcfg.startline = 0; myvar.bdcfg.keycolumn = 0; myvar.bdcfg.onlycolumn = 0;

bigdata bd = new bigdata(); bd.configbyvar(myvar); bd.initdatatable();

bd.arrdata = toarray(dt);

bigdatatosqlserver b2s = new bigdatatosqlserver();

b2s.connectionstring = myvar.sqc.connectstring;

b2s.tablename = tablename;

int importedcount = bd.writedatatablefromarray();

b2s.dtdata = bd.dtdata; b2s.copytoserver();

return importedcount;

}/// /// excel二維陣列轉datatable

///

///

///

public static datatable todatatable(object[,] arr)

dt.rows.add(dr);

}return dt;

}/// /// datatable轉換成二維陣列(excel從1開始)

///

///

///

public static object[,] toarray(datatable dt)

, new int32 );

for (int i = 0; i < dt.rows.count; i++)

return (object[,])arr;

}

同乙個IP繫結2個網域名稱

technorati 標籤 ip,網域名稱 同乙個ip繫結2個網域名稱 假設已經在isp那裡申請了2個網域名稱www.test1.com www.test2.com,而且都是繫結到伺服器的公網ip是192.168.1.100.test1是apache在本機的乙個應用,訪問url為http 192.1...

js和jQuery 同乙個例項

id dst value 4 諾基亞n85原裝充電器 option value 3 諾基亞原裝5800耳機 option value 7 諾基亞n85原裝立體聲耳機hs 82 option value 9 諾基亞e66 option value 13 諾基亞5320 xpressmusic opti...

linux vnc 與server共享同乙個桌面

伺服器端 需要安裝軟體 tightvncserver 和 vnc4server,可以google,這裡就不解釋了,網上很多。我這裡是ubuntu 1.sudo apt get install tightvncserver 2.sudo apt get install vnc4server 3.vnc...