Simple Application Using .NET Part I
On this article, i will share my knowladge about how to make a simple application "CRUD" (Create, Read, Update, Delete) in .NET. One days ago, i get a request from some one that want to learn about .NET application using ADO.NET
For this part i give a simple application that using MS Access as a database application. We using System.Data.OleDb namespace for this.
This is the code snippet for this simple application:
Try
Using Conn As New OleDbConnection(connString)
Conn.Open()
Using sqlCommand As New OleDbCommand()
With sqlCommand
.CommandType = CommandType.Text
.CommandText = _stringSQL
.Connection = Conn
.ExecuteNonQuery()
End With
End Using
End Using
Return True
Catch ex As Exception
MsgBox(ex.Source & " : " & ex.Message, MsgBoxStyle.Exclamation, "Error Messages")
Return False
End Try
This metode we use for execute the sql command that given in INSERT, UPDATE and DELETE command.
Then when we want to bind database field or READ from database, we use OleDbDataAdapter and fill it to DataTable
Try
Using Conn As New OleDbConnection(connString)
Using daResult As New OleDbDataAdapter(_stringSQL, Conn)
daResult.Fill(_dtResult)
End Using
End Using
Catch ex As Exception
MsgBox(ex.Source & " : " & ex.Message, MsgBoxStyle.Exclamation, "Error Messages")
End Try
For detail you can download SimpleApplication source to learn more from there.
I hope this article can help everyone who want to learn .NET espesially in database application.


hatur nuhun kang…..^_^
Comment by khulafa — May 14, 2008 @ 4:00 am
hatur nuhun kang…..^_^
Comment by khulafa — May 14, 2008 @ 4:00 am
hiks…CRUD
hatur nuhun kang… ^_^
Comment by khulafa — May 14, 2008 @ 4:37 am
hiks…CRUD
hatur nuhun kang… ^_^
Comment by khulafa — May 14, 2008 @ 4:43 am
Nice work.
Comment by vberror13 — May 15, 2008 @ 8:48 am
hahaha…
sangkyu..sangkyu sangadh..
Comment by crutz — March 24, 2009 @ 8:14 am