C如何檢視sql資料庫大小,C 如何檢視sql資料庫大小

2022-11-22 16:39:19 字數 2646 閱讀 1622

1樓:匿名使用者

右鍵點選資料庫名字,屬性,可以檢視資料庫大小

c#如何判斷查詢sql資料庫是否有此條記錄?

2樓:匿名使用者

查一條資料的記錄的話,

在select 後面加個 count(列名) from 表名 where條件

就可以了,返回的count 用int 的變數去接受沒有記錄是0

c#如何獲取sqlserver的欄位的長度?

3樓:匿名使用者

方法很多,比如說select * from syscolumns where id=object_id('a' ) where name='b'

或者用c#的getoledbschematable,其它方法參照

c#中如何接收從sql資料庫中查詢出的項?

4樓:匿名使用者

string str=(string)cmd.executescalar(); 如果只有一個string類資料可以這樣,效率很高 如果有很多資料,就要這樣: datatable dt = new datatable(); sqldataadapter adp = new sqldataadapter(cmd); adp.

fill(dt); 把資料都取到資料表中

怎麼比較sql和c#的datetime

5樓:禕正誼

可以直接比較,但前提是需要格式相同

例如資料庫中是2013-05-06,datetime中必須也要是2013-05-06,其他均不可以,例如2013-5-6

6樓:翅膀的初衷

可以直接比較,sql與c#都可以直接比較

sqlwhere adddate >= '2013-08-26 00:00:00'

where adddate >= '2013-08-26 00:00:00' and adddate >= '2013-08-26 23:59:59'

where adddate between '2013-08-26 00:00:00' and '2013-08-26 23:59:59'

c# if(datetime.now > datetime.parse("2013-08-26"))

if (((timespan)(datetime.now - datetime.parse("2013-08-26"))).milliseconds>0)

7樓:匿名使用者

先試下嗎,不可以的話就在sql中convert轉換成datetime就可以了。

8樓:匿名使用者

可以,不需要轉換的,sqlparameter已經轉換完了

9樓:匿名使用者

你的意思是用c#匯入sql資料嗎?

c#如何獲取到資料庫所有資訊並輸出?

10樓:匿名使用者

public static datatable userlogin(dlogin user)

11樓:匿名使用者

使用executereader()方法,返回值為sqldatareader型別:

using(sqlconnertion conn=new sqlconnertion(connectionstring))}

12樓:愈葉孤丹

如果說select * from userinfo裡面有int型別的賬號列(userid),string型別的密碼列(userpass)。你想獲取其賬號和密碼。

你用sqldatacommand物件cmd.executescalar()方法肯定是不行的。

要用cmd.executereader()方法才行。再用read物件接收。

連起來就是sqldataread read=cmd.executereader()

然後if(read.read())

13樓:水瓶座隨緣

datatable dt=方法("secelt * from userinfo"):

前臺空間繫結=dt;

前臺繫結顯示.databind();

14樓:

("secelt * from userinfo", conn);

這邊語法錯誤

單詞拼錯了》select

15樓:匿名使用者

1樓已經回答的很清楚

如何檢視sqlserver資料庫版本

16樓:

本文為大家介紹檢視sqlserver資料庫版本資訊的幾種方法。

17樓:匿名使用者

樓主,資料庫管理器內執行 「select @@version」!

(*^__^*) 嘻嘻……

C中如何用textbox查詢sql資料庫裡的資料並顯示在d

其實很簡單。我們只需要在窗體上拖放一個datagridview然後雙擊窗體空白處,在 檔案的form1 load事件中新增括號裡的 private void form1 load object sender,eventargs e 即可,sqlconnection conn new sqlconne...

C如何連線資料庫

是不是你的資料庫路徑這麼寫不識別啊 是不是冒號的問題啊?應該是分號吧 另外,integratedsecurity中間應該有空格,integrated security 不知道樓主搞的這麼複雜幹什麼,直接 sqlconnection conn new sqlconnection data source...

C與SQL資料庫連線用C做介面,並且建立資料庫及建立表

c 連線sql資料庫 連線資料庫的步驟 1 建立sqlconnection物件 2 指定sqlconnection物件的connectionstring 屬性 3 開啟資料庫連線 4 指定sql語句 5 建立sqldataadapter物件和dataset物件 mydataadapter new s...