Thursday, March 5, 2009

Setting Instalasi Sql Server 2005 Express

1. Configuration Manager2. Network Config - Protocol SQL Express3. IP Address - Enabled Yes4. Browser harus otomatis hidup
Membuat SQL Dual Mode: Windows dan SQL Server AuthenticationHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQL.ServerLogin Mode = 2
Surface ConfigurationRemoteConnection = Using TCP/IP
Jika Database ReadOnly1. Buka sql server configuration tools ->Sql server configuration manager -> clicksql server service -> click kanan sql server disebelah kanan -> pilih properties-> pada tab Logon ->opsi pilih built in -> dan pilih local system -> atach lagi database tsb2. maka cek diformat apa database disimpan Di NTFS atau Fat32 jika di NTFS maka set semua user menjadi Full Control

Thursday, February 19, 2009

Berpindah Kolom pada baris yang sama di datagridview


Public Class Form1

Public IdxRow As SByte
Public IdxCol As SByte

Sub lanjut()
IdxRow = Datagridview1.CurrentCell.RowIndex - 1
IdxCol = Datagridview1.CurrentCell.ColumnIndex
End Sub

Private Sub dg_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg.CellEnter
lanjut()
End Sub

Private Sub Datagridview1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dg.KeyUp
If e.KeyCode = Keys.Enter And posCol <>
Datagridview1.CurrentCell = DataGridview1(IdxCol + 1, IdxRow)
Else
Datagridview1.CurrentCell = Datagridview1(0, IdxRow + 1)
End If
End Sub

End Class

Meng-attach Database SQL Server Tanpa Disertai Log File

Sumber : http://www.geocities.com/s_udirman

Database pada SQL Server terdiri dari dua file yaitu file datanya (yang disimpan dengan ekstensi .MDF) dan file log-nya (yang disimpan dengan ekstensi .LDF). Jika kita meng-attach suatu database melalui Enterprise Manager maka perlu menyertakan kedua file tersebut. Bagaimanakah jika kita hanya memiliki file .MDF nya saja?
Caranya mudah sekali, pada SQL Server terdapat stored procedure sp_attach_single_file_db. Stored procedure ini memang digunakan untuk meng-attach database yang hanya file data-nya saja (.MDF nya saja). Stored procedure ini memiliki dua buah parameter yaitu @dbname dan @physname. Parameter @dbname digunakan sebagai nama database yang hendak di-attach ke server sedangkan parameter @physname adalah nama fisik database (.MDF nya) termasuk path nya.
Sintaks dari stored procedure ini adalah sebagai berikut:
sp_attach_single_file_db [ @dbname = ] 'dbname', [ @physname = ] 'physical_name'
Pada saat Anda menjalankan stored procedure ini disertai dengan database yang hendak Anda attach maka secara otomatis SQL Server akan membuat file log (.LDF) yang baru. Cara ini juga banyak digunakan oleh orang lain untuk memperkecil ukuran dari log file SQL Server.
Berikut ini adalah contoh penggunaan stored procedure sp_attach_single_file_db. Misalnya Anda memiliki database yang bernama db_databarang dengan nama file fisik c:\sqlsvr\data\databrg.mdf. Maka perintah untuk meng-attach database tersebut adalah seperti di bawah ini.
sp_attach_single_file_db @dbname = 'db_databarang', @physname = 'c:\sqlsvr\data\databrg.mdf'
Demikianlah tips singkat seputar SQL Server ini. Semoga bermanfaat bagi Anda semua. Special thanks to Esa Ivani for love and support. Segala macam kritik dan saran bisa dikirimkan melalui sony-ak@sony-ak.com. Untuk melihat tulisan menarik lainnya silakan kunjungi http://www.sony-ak.com/.
Terimakasih.

Thursday, February 12, 2009

The request failed with HTTP status 401: Access Denied

Pada saat kita akses web service tiba-tiba terjadi error "The request failed with HTTP status 401: Access Denied" ini disebabkan setting IIS kita belum benar. Langkahnya : (sumber http://geekswithblogs.net/ranganh/archive/2006/02/21/70212.aspx)

We can resolve this issue by either of the following ways:
Enabling Anonymous Access in the IIS Directory SecurityTo do this, the following steps will help you.
1. Click "Start" - "Run" - Type "inetmgr" and press "Ok" or "Enter" Key
2. IIS Control panel opens.
3. Expand the appropriate nodes and navigate to the virtual directory of your Web Service Application.
4. Select the Virtual directory, Right Click and select "Properties"
5. Switch to the "Directory Security" Tab and then Click "Edit".
6. Check the "Anonymous Access" CheckBox.
7. Click "Ok" twice to exit.This should solve the issue.

2. Programattically assigning the Credential CacheIn case you dont have access to change the IIS Settings or you just dont want to allow anonymous because other applications are using it, then you can programatically provide the permissions by specifying the credential cache.Let us assume we have a Webservice, Service which has the default Web Method HelloWorld. Let us see the steps involved in accessing the service.Service Service1 = new Service();Service1.PreAuthenticate = true;Service1.Credentials = System.Net.CredentialCache.DefaultCredentials;Response.Write(Service1.HelloWorld());As you can see, we are passing the CredentialCache object for the Service1.This would ensure that we preauthenticate the access to the Service. This would be applicable in the case of Integrated Windows Authentication scenarios.Cheers and Happy Programming !!!
-->