using system;
using system.collections.generic;
using system.componentmodel;
using system.data;
using system.drawing;
using system.text;
using system.windows
.forms;
using system.data.oledb;
using system.data.sqlserverce;
using system.io;
namespace readsdffileondesktop
private void buttoncreatedb_click(object sender, eventargs e)
else
}private void createdatabase()
private void buttoncreatetable_click(object sender, eventargs e)
catch (sqlceexception ex)
finally
}else
}private void buttonimportdata_click(object sender, eventargs e)
', '', '', '', '', '', '', '')",
oledbdr.getvalue(oledbdr.getordinal("emp_id")),
oledbdr.getvalue(oledbdr.getordinal("fname")),
oledbdr.getvalue(oledbdr.getordinal("minit")),
oledbdr.getvalue(oledbdr.getordinal("lname")),
oledbdr.getvalue(oledbdr.getordinal("job_id")),
oledbdr.getvalue(oledbdr.getordinal("job_lvl")),
oledbdr.getvalue(oledbdr.getordinal("pub_id")),
oledbdr.getvalue(oledbdr.getordinal("hire_date")));
sqlcecmd.commandtext = strsql;
sqlcecmd.executenonquery();
}messagebox.show("資料匯入成功!");
}catch (sqlceexception ex)
finally
}catch (oledbexception ex)
finally
}private void buttonshowdata_click(object sender, eventargs e)
}catch (sqlceexception ex)
finally}}
}
QT連線本地資料庫
最近做專案需要使用qt做乙個 想法是直接繫結本地資料庫字段然後顯示就行了,由於剛學習qt不久,過程十分曲折,先部落格一篇僅作記錄,新手上路,歡迎批評指正。在qt中有自帶的qsql類是用來運算元據庫的,本著物件導向的原則,我決定將資料庫連線封裝成乙個類。先引入標頭檔案 include 執行緒保護序列化...
Qt連線本地Access資料庫
最近做專案需要使用qt做乙個 想法是直接繫結本地資料庫字段然後顯示就行了,由於剛學習qt不久,過程十分曲折,先部落格一篇僅作記錄,新手上路,歡迎批評指正。在qt中有自帶的qsql類是用來運算元據庫的,本著物件導向的原則,我決定將資料庫連線封裝成乙個類。先引入標頭檔案 include 執行緒保護序列化...
本地連線遠端資料庫
1.對所有使用者進行授權 grant all privileges on to myuser identified by mypassword with grant option flush privileges 如果你想允許使用者myuser從ip為192.168.1.6的主機連線到mysql伺服...