6月18日設置
Posted by No Name Ninja - 2007.07.22,Sun
Private Function hogeHashTable() As Boolean
Dim ht As Hashtable
Dim strKey As String
Dim strArray As String()
Dim strVal As String
ht = New Hashtable
strKey = "01"
strArray = New String() {"japan", "nippon"}
ht.Add(strKey, strArray)
strKey = "02"
strArray = New String() {"pen", "enpitsu"}
ht.Add(strKey, strArray)
If ht("01") Is Nothing Then
Else
strVal = CType(ht("01"), Array)(0) 'japan
strVal = CType(ht("01"), Array)(1) 'nippon
End If
If ht("02") Is Nothing Then
Else
strVal = CType(ht("02"), Array)(0) 'pen
strVal = CType(ht("02"), Array)(1) 'enpitsu
End If
End Function
連想配列。結構使える。PR
Posted by No Name Ninja - 2007.07.22,Sun
Imports System.Data.OleDb
Private Function hogeDb() As Boolean
Dim sqlConn As OleDbConnection
Dim strConn As String
Dim strSql As String
Dim sqlCmd As OleDbCommand
Dim sqlRec As OleDbDataReader
Dim strField As String
strConn = strConn & "Provider = hoge"
strConn = strConn & ";Data Source = hoge"
strConn = strConn & ";User Id = hoge"
strConn = strConn & ";Password = hoge"
strConn = strConn & ";"
sqlConn = New OleDbConnection
sqlConn.ConnectionString = strConn
sqlConn.Open()
strsql = "select * from hoge"
sqlCmd = New OleDbCommand
sqlCmd.CommandText = strSql
sqlCmd.Connection = sqlConn
sqlCmd.CommandTimeout = 10
sqlRec = sqlCmd.ExecuteReader
strField = sqlRec("FIELD")
sqlRec.Close()
sqlRec = Nothing
sqlCmd.Dispose()
sqlConn.Close()
End Function
Posted by No Name Ninja - 2007.07.22,Sun
Imports System.Xml
Private Function hoge() As Boolean
Dim xDoc As XmlDocument = New XmlDocument
Dim xNode As XmlNode
Dim strUserId As String
xDoc.Load("hoge.xml")
xNode = xDoc.SelectSingleNode("CONFIG/CONNECT/USERID")
strUserId = xNode.InnerText
End Function
XML結構扱いやすいね。
Posted by No Name Ninja - 2007.07.19,Thu
select a.name as テーブル名, a.id as テーブルid, b.name as 列名, b.xtype, c.name as データ型, b.length as サイズ, b.colid as 列順番 from (select name, id from sysobjects) a inner join (select name, id, xtype, length, colid from syscolumns) b on a.id = b.id inner join (select name, xusertype from systypes) c on b.xtype = c.xusertype where a.name = @tableこれで簡単な定義書作れそう。
前のページ
《
カレンダー
カテゴリー
フリーエリア
最新コメント
[05/16 backlink service]
最新記事
(09/18)
(11/17)
(10/03)
(07/21)
(07/20)
最新トラックバック
プロフィール
HN:
No Name Ninja
性別:
非公開
ブログ内検索
最古記事
カウンター
アクセス解析
Template by mavericyard*
Powered by "Samurai Factory"
Powered by "Samurai Factory"
