.: Easy Soft Technologies :.

May 14, 2008

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.

6 Comments »

The URI to TrackBack this entry is: http://easysoft.blogsome.com/2008/05/14/simple-application-using-net-part-i/trackback/

  1. hatur nuhun kang…..^_^

    Comment by khulafa — May 14, 2008 @ 4:00 am

  2. hatur nuhun kang…..^_^

    Comment by khulafa — May 14, 2008 @ 4:00 am

  3. hiks…CRUD
    hatur nuhun kang… ^_^

    Comment by khulafa — May 14, 2008 @ 4:37 am

  4. hiks…CRUD
    hatur nuhun kang… ^_^

    Comment by khulafa — May 14, 2008 @ 4:43 am

  5. Nice work.

    Comment by vberror13 — May 15, 2008 @ 8:48 am

  6. hahaha…
    sangkyu..sangkyu sangadh..

    Comment by crutz — March 24, 2009 @ 8:14 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com