直播中
mysqlsvr .connect("sqlservername","uid","pws");
獲得數(shù)據(jù)庫(kù)信息:
rc3sqldmo.databases mydbs=mysqlsvr.databases;
rc3sqldmo.database2 mydb =new rc3sqldmo.database2class();
mydb=mydbs.item("dbname","owner"); 或mydb=mysqlsvr.databases.item("dbname","owner");
獲得表和字段的信息:
rc3sqldmo.Tables mytbls= mysqlsvr.databases.item("dbname","owner").tables;
rc3sqldmo.table2 mytbl = new rc3sqldmo.table2class();
mytbl = mytbls.item("tablename","owner");或
mytbl = mysqlsvr.databases.item("dbname","owner").tables.item("tablename","owner");
string[3] mylist = new string[3];
rc3sqldmo.column2 myfield = new rc3sqldmo.column2class();
foreach(object o in mytbl.columns)
{
myfield = (rc3sqldmo.column2) o;
mylist[0]=myfield.name;
mylist[1] = myfield.datatype;
mylist[2] =myfield.length.tostring();
}
獲得存儲(chǔ)過(guò)程的信息::
rc3sqldmo.storedprecudure2 mysp = new rc3sqldmo.storedprecudure2class();
mysp =mysqlsvr.batabase.itrm("dbname",owner).storedprecudures.item[B("spname",owner)]
用途的討論::
動(dòng)態(tài)管理sql server
動(dòng)態(tài)獲得table,storedprecudure的結(jié)構(gòu)信息
還能增加,修改所有sql server object的內(nèi)容。