基於VS2005的,資料庫連線

2021-05-26 07:18:53 字數 645 閱讀 6835

1 sql2000資料庫小圖示需要是綠顏色

2 開啟企業管理器

3 新建資料庫test1

4 建立表teacher_table (tid,tname,tpassword)

5 修改sa 密碼

6 建立乙個winform 程式

7 畫介面

8 參考**,執行資料庫操作。

9 測試執行。

using system;

using system.collections.generic;

using system.componentmodel;

using system.data;

using system.drawing;

using system.text;

using system.windows.forms;

//訪問sql 資料庫都需要如下引用

using system.data;

using system.data.sqlclient;

private void button1_click(object sender, eventargs e)

else

conn.close();

}catch (exception exc)}}

}}

資料繫結,vs2005

vs2005裡面的資料繫結越來越花哨了,好像新增了object繫結,還沒仔細研究。以前玩窗體資料繫結的時候,對繫結單個物件比較迷惑,經常作成陣列或者list去繫結,現在好像不用這樣玩了,而且有ipropertychanged介面可以通知控制項資料發生變化,同樣,可以自己構造集合性質的繫結資料來源,只...

C 例項 VS2005和Access資料庫操作

一 form1的設計 對應的 using system using system.collections.generic using system.componentmodel using system.data using system.drawing using system.text usin...

VS2005資料窗體嚮導

vs2005資料窗體嚮導 以前在vs2003裡,直接用資料窗體嚮導生成資料繫結窗體。但在vs2005裡卻找不到了,是不是vs2005上面就沒有了啊?其實vs2005上肯定是有的,就讓我們來做個小例項吧 首先新建乙個專案 1 開啟 資料來源視窗 單擊 資料 選單上的 顯示資料來源 圖一 以顯示資料視窗...