mysqlsvr .connect("sqlservername","uid","pws");
获得数据库信息:
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();}
获得存储过程的信息::
rc3sqldmo.storedprecudure2 mysp = new rc3sqldmo.storedprecudure2class();mysp =mysqlsvr.batabase.itrm("dbname",owner).storedprecudures.item[B("spname",owner)]
用途的讨论::
动态管理sql server动态获得table,storedprecudure的结构信息还能增加,修改所有sql server object的内容。