Laman

Kamis, 22 Juli 2010

koneksi C# dengan DBMS Mysql

Kali ini saya akan membahas tentang koneksi data antara C# dengan DBMS (Mysql,Oracle,Dbase,Acces,Sql Server, dan DBMS-DBMS lainnya). akan tetapi dalam project ini nanti saya menggunakan DBMS MySql, sebenarnya model koneksi semua DBMS dengan FrameWork dotNet mempunyai struktur yang sama, yang membedakan antara satu DBMS dengan DBMS laiinya hanyalah baris connection String nya saja.
Sebelum kita memulaimproject satu hal yang perlu diketahui, untuk masing-masing DbMS kita membutuhkan satu atau lebih file DDL dari masing-masing DBMS, untuk file dll MySql Bisa di download Di sini . Oke Sekarang Mari Kita mulai membuat programnya.
1. langkah pertama, mari kita buat project baru, klik file->new->project, beri nama projectnya

2. Langlah selanjutnya adalah meng add reference file dll mysql ke dalam project yang telah kita buat tadi. masuk project->add reference. masuk tab browser dan cari file mysql.data.dll, klik ok. Untuk lebih detail tentang add reference silahkan klik disini


3. kita harus manambahkan library kedalam project yang kita buat, masuk ke jendela coding dan ketikan beberapa sintak berikut ini





 
4. Kita tambahkan fungsi untuk meload(membaca data dari database), berikut ini adalah potongan fungsi tersebut. sebelumnya kita harus mendeklasrasikan connection string . untuk code connection string Mysql adalah sebagai berikut ini


server=localhost  adalah code yang menerangkan kepada program bahwa kita menggunakan server local, sedangkan database=tugaspbdw adalah nama dari database yang kita gunakan; uid=root;password=; adalah type user yang kita gunakan dalam DBMS, disini type user yang saya gunakan adalah Root dengan password kosong (tidak ada password)
fungsi untuk load database
               

donwload fullproject disini
contact me on informasi@csharp-indonesia.com

58 komentar:

  1. kalo yang buat aplikasi test online sederhana ada ga???

    BalasHapus
  2. maksdunya tek program ini secara online atau aplikasi yang digunakan untuk tes online..???

    kalau yang saudara maksud adalah aplikasi yang digunakan untuk tes ujian online, C# bisa digunakan untuk membuat aplikasi tersebut. C# mirip seperti dengan java, dalam hal jaringan juga tidak jauh berbeda dengan java, codenya pun hampir mirip.

    akan tetapi kalau suadara menginginkan aplikasi tersebut, maaf saya belum bisa membagikan aplikasi tersebut, akan tetapi akan saya usahakan posting potonga-potongan source codenya

    BalasHapus
  3. maaf sebelumnya saya baru2 ini belajar C# , saya pake vs 2010 , ketika saya pake konektor mysql versi 5 ternyata ga bisa di build . saya coba lagi versi 6 nya ternyata ada sebuah perbedaan , oleh karena itu saya mohon bantuannya dalam membangun source code nya. terimakasih banyak .

    BalasHapus
  4. untuk visual studio 2010, default framework yang digunakan adalah framework 4.0, sedangkan tidak semua library suppord dengan framework 4.0, untuk mysql connecttor 6 kami belum mencoba menggunakannya di visual studio 2010 dengan berbagai framework. Untuk beberapa DBMS yang sudah kami coba, memang untuk framework 4,0 tidak support, cara untuk mengakalinya adalah downgrade framework menjadi 2.0. Untuk hasil ujicoba dengan mysql connector 6 di visual studio 2010 akan kami posting di blog ini. Terimakasih

    BalasHapus
  5. saya memakai visual studio 2005..
    bagaimana cara koneksi database menggunakan oracle 8i? kalau koneksinya menggunakan class?
    Terimakasih atas bantuannya..

    BalasHapus
  6. saya memakai vs 2005, klo cara membuat database mysql nya sendiri gimana ya mas???
    mohon pencerahannya

    BalasHapus
  7. untuk sampai saat ini belum pernah mencoba menkoneksikan dengan DBMS Oracle, ini dikarenakan kebanyak di dunia edukasi banyak memakai MYSQL dan SQL server, untuk koneksi dengan DBMS Oracle nanti akan saya coba coba dech. :-D

    BalasHapus
  8. Visual Studio 2005 hanyalah sebuah IDE dalam mengembangkan Bahasa C#, sebenarnya tanpa VISUAL STUDIO kita bisa membangun sebuah aplikasi .NET, hanya saja karena fitur fitur yang ditawarkan oleh IDE Visual studio itu sangat membantu Programer dalam mendesain aplikasi disarankan menggunakan IDE Visual Studio, Sedangkan untuk DBMS MYSQL ini bisa dibuat dengan menginstal terlebih dahulu MYSQL untuk tutorial tentang MYSQL silahkan buka link berikut ini www.mysql.com/
    pada link tersebut dijelaskan mulai dari dasar sampai pada level expert, Semoga bisa membantu, terimakasih

    BalasHapus
  9. Syamsuddin Adam Namma7 Maret 2012 pukul 13.30

    Assalam mualaikum...bisa minta tolong kirimkan Program data penjualan barang electronik ( Client server )makasih sebelumnya

    BalasHapus
  10. ko tidak bisa di download library nya

    BalasHapus
  11. csharp-indonesia.com20 Maret 2012 pukul 14.35

    maaf.. mungkin link nya sudah expire,
    silahkan download alternative linknya disini
    www.scampers.org/steve/sms/libraries.htm

    BalasHapus
  12. csharp-indonesia.com20 Maret 2012 pukul 15.08

    maaf untuk program seperti itu saya tidak berani membaginya, karena tersanding dengan hak cipta, saya tidak punya kewenangan untuk membaginya.

    terimakasih., semoga bisa membantu

    BalasHapus
  13. csharp-indonesia.com20 Maret 2012 pukul 15.09

    maksdunya tek program ini secara online atau aplikasi yang digunakan untuk tes online..???

    kalau yang saudara maksud adalah aplikasi yang digunakan untuk tes ujian online, C# bisa digunakan untuk membuat aplikasi tersebut. C# mirip seperti dengan java, dalam hal jaringan juga tidak jauh berbeda dengan java, codenya pun hampir mirip.

    akan tetapi kalau suadara menginginkan aplikasi tersebut, maaf saya belum bisa membagikan aplikasi tersebut, akan tetapi akan saya usahakan posting potonga-potongan source codenya

    BalasHapus
  14. sy pake VS10 ud download fullproject diatas, pas running kok gak bsa ? muncul pesan
    "Access denied for user 'root'@'localhost' (using password: NO)"

    sy udah ikutin add reference file dll mysql ke dalam project
    mksdnya apa ya ?
    mohon pencerahannya

    BalasHapus
  15. mas saya mau tanya, kok pas saya download fullprojectnya kok malah ke detect sama antivirus saya,, jadi ga bisa di download,,, ada project yg lain ga tp yg sama kayak tutorial diatas,,,

    BalasHapus
  16. makasih mass infonya..

    info seputar bola, prediksi bola ter-update..

    berita bola TERBARU DAN TERPERCAYA hanya ada di www.bola368.net

    Kunjungi juga www.bola368.org, Anda puas Kami pun senang.!

    BalasHapus
  17. mas klw tutorial insert ,delete ,update dengan database mincrosoft acses dong di share

    BalasHapus
  18. Sebenarnya didalam ,NET di permudah dalam hal proses koneksi dengan database, DBMS apapun yang digunakan entah itu MYSQL, SQLSERVER, POSTGREE, ACCES atau database yang lainnya mempunyai aturan yang sama, mungkin yang membedakan antara satu DBMS dengan DBMS yang lainnya hanyala koneksi string dari masing-masing spesifikasi DBMS yang digunakan

    BalasHapus
  19. ini untuk connection string acces :
    string connStr="Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:\\NWIND.mdb";

    BalasHapus
  20. gan, jangan pake ziddu gan buat dll mysql connect nya...gak bisa di akksesses. tengkyu

    BalasHapus
  21. oke.. terimakasih infonya.
    ini link yang baru
    ziddu :http://adf.ly/frdOR
    mediafire : http://adf.ly/frdau
    4share : http://adf.ly/frdkD
    semoga bisa bermanfaat

    BalasHapus
  22. pak,kapan ni diajari socket programmingnya ?

    BalasHapus
  23. sabar.. sabar.... diusahakan secepatnya.....

    BalasHapus
  24. permisi mas, klo untuk set data per kolomnya dimananya ya ?

    BalasHapus
  25. If anything, we probably need more individual expressions of style, even if they are a minimalist whisper. michael kors sale A couple of years ago, Simons created an eclectic Dior collection around the notion of freedom, with styles loosely inspired by a variety of global influences. You may ask: Aren’t we already free to pick and choose? But Simons was really addressing michael kors cynthia satchel fashion insiders. Because, while we may live in a post-trend universe, there is still consensus among editors and buyers about what is cool or chic in a given season. In a way, insiders cling to the notion of clearly defined themes more michael kors bags than anyone else; that’s why you see the same styles repeated in stores. Simons was simply arguing for more open-mindedness, more oddball gems in the mix.
    According to legend — and nobody loves to mythologize Kors more than he does — he michael kors belts for women designed the dress for his mother’s second wedding when he was 5 years old. At 16, instead of going to his prom, he stopped by “to watch the red carpet arrivals,” and then headed off to Studio 54, where he was a michael kors cheap screwdriver-drinking regular in “Olivia Newton-John ‘Physical’-era” outfits. A short stint in acting school was followed by a shorter one at the Fashion Institute of Technology; he dropped out after nine months to work at Lothar’s boutique, whose owner gave him the chance michael kors black hobo to display his own designs. Soon after, Kors was discovered by Dawn Mello, Bergdorf Goodman’s fashion director at the time, who set his career on the right path, and by 1981, at the age of 22, his clothing was being sold in michael kors purses stores around the country.Even as a child, he was drawn to the rush of adventure. When, in grade school, his classmates brought guppies for show and tell, he brought European currency.

    BalasHapus
  26. An ounce of prevention is worth a pound of cure, so the old saying goes. And what could be easier for golfers to prevent eye problems caused by sun exposure than slipping on a pair of golf sunglasses? Oakley Fuel Cell Sunglasses And it looks like a lot of professional players are taking this adage to heart. Weve seen them on television wearing sunglasses for golfers: Karrie Webb, David Duval, Annika Sorenstam, to name a few. And various types of golf sunglasses oakley sale have been endorsed by the sports superstars such as Tiger Woods for Nike. Since golf has become a much higher-profile sport, golfing accessories, apparel and paraphernalia have increased consumer awareness about them, too. In fact, sunglasses for golfers have enlarged Oakley Double Lens Sunglasses their share in the global market for sunglasses.There are various styles and designs to fit every golfers need. Golf eyewear with polarized lenses is especially helpful on bright, sunny days because they cut down the glare from sunlight that bounces oakley vault off some surfaces. Different tints play a role, too, in how golfers view a course. Lenses that are amber in color filter blue light, and these are reputed to enhance viewing of far-off objects. Yellow and orange lenses are ideal cheap oakley sunglasses for low-light conditions, while clear lenses are good for darker conditions. Some sunglasses for golfers also come with changeable lens systems oakley frogskins just snap in the lenses that are most suited for the current playing conditions. Whether ones choice of sunglasses has dark or light lenses, it is important to remember that it should have excellent ultraviolet protection; some people mistakenly think that there is little or no risk of ultraviolet radiation on overcast days, but that simply isnt so.

    BalasHapus
  27. Bold, classic and stunningly captivating, a pair of Ray-Ban Aviator sunglasses is a charmer. They add a dash of chic to the wearer’s look. Whether it’s a casual outing or a formal ray ban outlet event, donning a pair of these sassy sunnies can instantly draw attention towards you. Meant to perfectly complement both casual as well as sophisticated tailored outfits; they are the perfect match to accentuate your class, glamour and exuberant taste.Though the classic black Ray-Ban Aviator sunglasses have always been a favorite amongst all the fashion followers, the current fad is to pep up your style quotient with a pair of Ray-Ban Aviator sunglasses with flash lenses. Super stylish, flamboyant and absolutely glamorous, they are a hot favourite among celebrities and fashion icons ray ban wayfarer sale alike.
    On the other hand, Wayfarers might not suit every face shape. These shades are more suitable for a person with a long or rectangular face. Today, one can also choose from Wayfarers in various colours too.The main purpose of sunglasses is to protect your eyes from the sun. And the protection comes entirely from the lenses that are used. One ray ban sunglasses must know that there are different types of lenses available with Ray-Bans and one must select them according to the need.Standard lenses: Initially made for military use, the iconic G-15 and B-15 lenses offer optimal levels of clarity, comfort and protection.Gradient: Keeping up with the latest trends, gradient lenses come in a wide range of exciting colors. So, if vintage colours cheap ray bans offer limited choice, one can go for colourful gradient lenses.
    Obviously, for Ray-Ban models with very thin temple "arms", like Aviators, no logo is present.Look for the model number inside the “arms” of the glasses. Look at the inside of the "arms" of the glasses that rest on your ears. If you have Wayfarers or Clubmasters, you should see white text ray bans cheap inside the arms. On the left arm, you'll see your glasses' serial and manufacturing numbers. On the right arm, you should see the Ray-Ban logo, "Made in Italy", and a stylized "CE" (which signifies that the glasses are certified to be sold in Europe). If this text is missing, smudged, or poorly-printed, your glasses are almost certainly fakes.
    The Ray-Ban logo ray ban glasses will be etched on both the lenses. On the right lens will be the Ray-Bay logo, while on the left lens, right below the hinges will be the initials ‘RB’.If the sunglasses have nose pads, there will be the initials ‘RB’ engraved right at the centre of the metal piece.And there are a few other points which you should keep in ray ban clubmaster mind, as far as original Ray-Ban sunglasses are concerned.Pre-2000 models of Ray-Ban sunglasses will have the initials ‘BL’ instead of ‘RB’ on the left lens.

    BalasHapus
  28. One of the reasons Ray-Ban has managed to stay top of mind with consumers has to do with Hollywood culture. Cult films such as Rebel Without a Cause, Breakfast at Tiffany's, and The Blues Brothers have helped popularize Ray-Ban's Wayfarer's, while movies ray ban wayfarer including Top Gun and Taxi Driver have done the same for Aviators.What do you like most about Ray-Ban's classic designs? Tell us in the comments below.Sunglasses maker Ray-Ban is spinning a new take on the traditional campaign for change by appealing to the humorous side of consumers through social media.
    Aviators were originally designed to protect the eyes of pilots with their shaded lenses that filtered out sunlight without blocking vision. ray ban glasses The minimal frames and dark lenses of Aviators have been copied by many other brands, but they are still considered the defining brand of these glasses. Many famous people have worn Aviators, including:General Douglas MacArthur in the Philippines. The French Army is also said to have widely worn Ray-Bans while in the Far East.Aviators were primarily a male sunglasses fashion type, but women also wore them. In fact, Aviators have come to symbolize ray ban sale serious attention to eye protection in a variety of fields including flying, driving and any job that requires protection from glare.Brand name sunglass fakes or knockoffs are quite common. While Simply Sunglasses guarantees that you will only receive real, certified Ray-Bans, it helps to be able ray ban clubmaster to spot a fake when you see one. Here are some tips for identifying “knockoffs.”
    So, jeepers creepers, why is Ray-Ban saying, “Don’t shade your peepers”? The idea is to find a playful way to encourage younger consumers, particularly those ages 18 to 25, to assert their individuality by revealing their sense of personal style.“It struck us as an ironic way to say, ‘Express yourself,’ ” said Chuck McBride, executive creative director for North America at the San Francisco office of the Ray-Ban creative agency, TBWA/Chiat/Day, part of the TBWA Worldwide division of the Omnicom Group.In research, “people said it was a little mixed up,” he ray ban outlet added, “but they got the intent.”
    Recently, apparel and accessories retailer Coach took a similar approach and invited Insta-famous personalities to customize pictures of bags in their own manner to celebrate consumer individuality (see more).Furthermore, according to a panel at Forrester’s Forum for Marketing Leaders, brands that market through social media need to focus on creating overall authenticity and positive image through multiple channels (see more). Brands such as Coach and Ray-Ban are ray ban sunglasses following that format with these campaigns.

    BalasHapus
  29. New York has come and gone, and for those who have barely had time to lift their heads, don't worry, we have taken the time to compile the most important trends from the city. Looking through the hundreds of collections has taught us plenty, and here is what we have learned: Relax. Really. Designers want their customers to take a load off. The reigning silhouette was a kate spade surprise sale little more casual and a little less rigid than usual. And even if a trend wasn't directly to related to living the good life, it was often styled in a way that seemed to suggest it. Not kate spade saturday sure what we mean? Scroll through to see.
    Student designs were selected for the show through a rigorous judging process led by this year's Style Lab Mentors: designers Juan Carlos Obando, Anna Corinna Sellinger, Christian Siriano and Daniel Vosovic as well as Frida Tjoa of Sam Edelman and Rita Watson of Kate Spade. All in, 37 fashion students and 15 accessory students were chosen to present 105 looks in Saturday's shows.
    But, it's not all depressing on the shopping front! Winter goods are also on their way out to make way for fresh new spring lines, kate spade bags and there are lots of great discounts to be found across the board. Check out the sales happening right now at our favorite retailers below."It was whimsical fairlytale," said Creative Director Deborah Lloyd at the presentation of Kate Spade New York's fall 2015 collection on Friday, when asked about her inspirations. "We've seen a lot of them in film recently, but I loved them growing up." kate spade handbags outlet Lloyd is British, so her childhood reference points skew European — Roald Dahl's "Tales of the Unexpected" and "Chitty Chitty Bang Bang." Truly Scrumptious, the character who famously sang that film's theme song, was Lloyd's childhood heroine. "There's an ode to her in the chocolate box bows and frills and pink." But the influence of one American film, "Fantastic Mr. Fox," visibly had a huge influence kate spade usa website in the fur accents and bright red plaids. "You'll see a few foxy ladies in here," she said.
    Beech feels a big part of that success owes to the fact that each film tells a story — with a beginning, middle and end — and that it’s a series, so that when a new film comes out, people have a reference point for it and want kate spade new york to see what’s next. The decision to cast only one star was also intentional, to lend continuity.Another fashion brand that has become known for telling stories with its growing ouvre of fashion films is Rachel Antonoff. A young designer with limited resources, Antonoff made films instead of showing at fashion week for two seasons in a row. In past interviews, the designer has told me that kate spade diaper bag her films have had a great reception and and are “easier to call in favors for” and thus cheaper than presentations to put together. It doesn’t hurt that Antonoff’s friends include people like Mae Whitman, Jenny Slate and Lena Dunham.

    BalasHapus
  30. With the Bluebird Breitling replica IV and V, Sir Malcolm Campbell set a record of 253mph (407km/h) in 1932 and 276mph (445km/h) in 1935, respectively. Since 1930, Sir Malcolm Campbell used to daily wear a Rolex,Hublot replica thus confirming Campbell as the first international, and spontaneous, ambassador for Rolex. In those days, the Rolex Daytona was not existing, the first Cosmograph will appear Patek Philippe replica only in 1963, but the brand was already associated with Daytona, and this paved the way for the chronograph to become legendary.

    BalasHapus
  31. Since the Sang Bleu’s second installment makes a rather profound first visual impression, allow me to set off on a theoretical note,replica audemars piguet followed by the more practical and technical aspects in a bit. If I were alone with what I’m about to say, I wouldn’t bother, but since I’ve seen many of my fellow watch enthusiasts display the same tendencies in watch taste, I’ll go ahead with it. In recent years, in my limited personal experience,replica bell & ross I found that the WIS (watch idiot savants) of the Internet have become notably and consistently less angry/frustrated/ape when being presented a new over-the-top watch. Surprisingly, this tendency also seems to have begun relieving the ice-breaker motherships of this genre: brands like Hublot, Richard Mille, Jacob & Co., and others seem to get considerably less hate these days than two or three years ago. I think the reason for this development is that more and more of us hardcore watch nerds are getting bored with regular watches.replica breitling (I’ll come back to this topic in another article dedicated to another BaselWorld 2019 release.) I don’t know about you, personally,replica cartier but I do know that to be true for myself.

    BalasHapus
  32. C is one of the lnguages though it is outdated nand replaced with c sharp, but is still used.
    http recruitment dpr gov ng

    http recruitment dpr gov ng

    BalasHapus
  33. the c language though is old is more even and compatible when compared to c sharp
    laest news on naptip recrruitment

    laest news on naptip recrruitment

    BalasHapus
  34. Looking for a very trusted online bookie? you will get benefits that you care about very much, now please click on the article below, because this link contains various types of strategies to register at the most trusted online slot bookie and will always provide freerolls and bonuses to its members If you want to know more, please click on the link here to continue reading articles from experienced slot players who are not stingy with this knowledge http://www.stefal.net/

    BalasHapus