1、前言使用SqlDataReader較之SqlDataAdapter速度上快,因為讀取記錄是一行一行的來,但是往往也感覺那么蹩腳。例如經常用到的如何從SqlDataReader中獲取DataRow呢?下面給出以下幾種方法。 2、DataSet.Load方法首先使用DataSet.Load ...
1、前言使用SqlDataReader較之SqlDataAdapter速度上快,因為讀取記錄是一行一行的來,但是往往也感覺那么蹩腳。例如經常用到的如何從SqlDataReader中獲取DataRow呢?下面給出以下幾種方法。 2、DataSet.Load方法首先使用DataSet.Load ...
獲得列名 select name from syscolumns where id=object_id('ds_field') 或 select col_name(object_id('table ...
...
...
psql查詢某個表的列名: select column_name from information_schema.columns where table_name='xx' and table_schema=''public; ...
獲得列名 select name from syscolumns where id=object_id('ds_field') 或 select col_name(object_id('table'),1) from sysobjects where name ...
獲取表的主鍵列名 SQL select * from user_cons_columns where constraint_name = (select constraint_name from ...
之前一直有個誤區,認為SqlDataAdapter不僅占內存,還沒有SqlDataReader讀取快,所以優選SqlDataReader。但是昨天與主管有意見上的爭議,總覺得沒弄明白不太甘心。 然后就研究了一番,首先了解二者的原理: 1.SqlDataReader提供一種從數據庫讀取行的只進流 ...