Dim hh = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("sp").ConnectionString Dim conn As New SqlConnection(hh) conn.Open() Dim Trans As SqlTransaction = conn.BeginTransaction() Dim sql = "Insert into stu(stu,c1,c2) values(115,'hello','kg')" Dim cmd As New SqlCommand(sql, conn, Trans) sql = "update the set t1='rockman' where the = 102" Dim cmd2 As New SqlCommand(sql, conn, Trans) Try cmd.ExecuteNonQuery() cmd2.ExecuteNonQuery() Trans.Commit() Catch ex As Exception Trans.Rollback() End Try cmd.Dispose() cmd2.Dispose() conn.Close() conn.Dispose()
2月 01, 2013
VB 資料庫插入並更新語法
6月 17, 2012
4月 02, 2012
GridView 設定文字底色
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound 'e.Row.Cells(1).BackColor = System.Drawing.Color.LightBlue 'GridView1.Columns(0).ItemStyle.BackColor = System.Drawing.Color.LightBlue 'GridView1.Rows(0).Cells(0).BackColor = System.Drawing.Color.LightBlue For i As Integer = 0 To GridView1.Rows.Count - 1 For j As Integer = 0 To 38 If GridView1.Rows(i).Cells(j).Text.Length = 2 Then GridView1.Rows(i).Cells(j).BackColor = System.Drawing.Color.LightBlue End If Next Next End Sub
3月 29, 2012
keytool android 金鑰的註冊
首先在Eclipse中的 Window->Preferences->Android->Build->Default debug keystroe 取得keystore的存放路徑 接著開啟CMD 到該路徑下 輸入以下命令 keytool -list -v -keystore debug.keystore[視檔名更改] 便可以獲得MD5編碼
訂閱:
文章 (Atom)