Simple Application Using .NET Part I
May 14, 2008 – 3:29 amOn 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.


5 Responses to “<b>Simple Application Using .NET Part I</b>”
hatur nuhun kang…..^_^
By khulafa on May 14, 2008
hatur nuhun kang…..^_^
By khulafa on May 14, 2008
hiks…CRUD
hatur nuhun kang… ^_^
By khulafa on May 14, 2008
hiks…CRUD
hatur nuhun kang… ^_^
By khulafa on May 14, 2008
Nice work.
By vberror13 on May 15, 2008