簡單的鏈結資料庫

2021-05-21 22:46:36 字數 808 閱讀 6598

hzblib.idal.isbiz sbiz = hzblib.dal.factory.createsbiz();

hzblib.model.collectionslist = sbiz.select("select * from s_biz");

string strconn = "server=192.168.8.101;uid=sa;pwd=sa;database=hzbus20090714;asynchronous processing=true";

if (slist.count > 0)

else if (xpoint1 != null)

else

sqlconnection conn = new sqlconnection(strconn);

string strsql = "insert into copy_sbiz values('"+strname+"','"+strmark+"','"+_x+"','"+_y+"','"+ strcatalog +"')";

//sqldataadapter da = new sqldataadapter(strsql, conn);

//dataset ds = new dataset();

//da.fill(ds);

conn.open();

sqlcommand comm = new sqlcommand(strsql, conn);

iasyncresult a = comm.beginexecutenonquery();

comm.endexecutenonquery(a);

conn.close();

資料庫鏈結

1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 orcl orcl為資料庫的sid strin...

SQL資料庫與treeview的簡單鏈結

一.c treeview控制項讀取sql資料庫 一.c treeview控制項讀取sql資料庫 1.ado.net提供種專門與資料庫鏈結的使用的類 2.核心物件 connection物件 用於鏈結資料來源 command物件 用於執行命令 datareader 唯讀模式下讀取資料 dataadapt...

PHP鏈結資料庫和簡單函式

1,鏈結資料庫 con mysqli connect localhost root root var dump link 2,判斷是否鏈結成功if con 3,設定字符集 mysqli set charset con utf8 4,選擇資料庫 mysqli select db con test 5,...