{"id":19,"date":"2008-09-14T16:13:39","date_gmt":"2008-09-14T13:13:39","guid":{"rendered":"http:\/\/www.notsayfam.com\/?p=19"},"modified":"2009-03-24T17:02:44","modified_gmt":"2009-03-24T14:02:44","slug":"vbnet-veritabani-baglantisi","status":"publish","type":"post","link":"https:\/\/www.notsayfam.com\/?p=19","title":{"rendered":"Vb.net\/ASP.Net veritaban\u0131 ba\u011flant\u0131s\u0131"},"content":{"rendered":"<p>SQL Server Kullan\u0131c\u0131 kimlik do\u011frulamas\u0131 y\u00f6ntemleri<br \/>\n&#8216;1 SQL kullan\u0131c\u0131s\u0131 kullanarak<br \/>\nData Source=SUNUCU;Initial Catalog=VERITABANIADI;User ID=VERITABANIKULLANICIADI;Password=SIFRE<br \/>\n\u20182 Entegre windows kimlik do\u011frulamas\u0131 i\u00e7in<br \/>\nData Source=SUNUCU;Initial Catalog=VERITABANIADI;Integrated Security=True<\/p>\n<p><span style=\"color: #ffffff;\">&#8216;<strong>ASP.Net \u00fczerinden Access veritaban\u0131<\/strong><\/span>na ba\u011flan\u0131p sorgu \u00e7al\u0131\u015ft\u0131ral\u0131m.A\u015fa\u011f\u0131daki \u00f6rnekte veritaban\u0131na ba\u011flan\u0131p kullan\u0131c\u0131 sorgulamas\u0131 yap\u0131l\u0131yor. sonuca g\u00f6re label \u00fczerine yaz\u0131 aktar\u0131l\u0131yor<br \/>\n&#8216;K\u00fct\u00fcphanelerimizi y\u00fckleyelim<br \/>\n<code>Imports System.Data.OleDb<br \/>\nImports System.Data<br \/>\nPartial Class Uyegirisi<br \/>\nInherits System.Web.UI.Page<\/code><br \/>\n&#8216;vt isimli bir ba\u011flant\u0131 tan\u0131ml\u0131yoruz ve ba\u011flant\u0131 satirini yaz\u0131yoruz<br \/>\n<code>Dim vt As New OleDbConnection(\"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=users.mdb\")<\/code><br \/>\n&#8216;Veritaban\u0131 \u00fczerinde sql komutlar\u0131 \u00e7al\u0131\u015ft\u0131rabilmek i\u00e7in command tan\u0131mlayal\u0131m<br \/>\n<code>Dim komut As New OleDbCommand<\/code><br \/>\n&#8216;\u00c7al\u0131\u015ft\u0131rd\u0131\u011f\u0131m\u0131z sorgu sonucunda elde edece\u011fimiz verileri  datareader \u00fczerine y\u00fckl\u00fcyoruz.<br \/>\n<code>Dim veriler As System.Data.OleDb.OleDbDataReader<br \/>\nDim i As Integer<br \/>\nProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br \/>\nTry<\/code><br \/>\n&#8216;veritaban\u0131n\u0131 a\u00e7al\u0131m<br \/>\n<code>vt.Open()<\/code><br \/>\n&#8216;\u00e7al\u0131\u015ft\u0131raca\u011f\u0131m\u0131z komutun hangi ba\u011flant\u0131 \u00fczerinde \u00e7al\u0131\u015faca\u011f\u0131n\u0131 atayal\u0131m<br \/>\n<code>komut.Connection = vt<\/code><br \/>\n&#8216;Sorgumuzu yazal\u0131m<br \/>\n<code>komut.CommandText = \"Select * from kullanicilar where kadi='\" &amp; kadi.Text &amp; \"'\"<br \/>\nkomut.ExecuteNonQuery()<\/code><br \/>\n&#8216;sorguyu \u00e7al\u0131\u015ft\u0131r\u0131p datalar\u0131 veriler isimli reader\u0131m\u0131za y\u00fckledik<br \/>\n<code>veriler = komut.ExecuteReader<br \/>\ni = 0<\/code><br \/>\n&#8216;okumaya ba\u015flayal\u0131m. zatan o kullan\u0131c\u0131 ad\u0131n\u0131 i\u00e7eren tek kay\u0131t olacakt\u0131r<br \/>\n<code>Do While veriler.Read<br \/>\ni = 1<\/code><br \/>\n&#8216;veri taban\u0131m\u0131zdaki alanlar (id,kullaniciadi,sifresi) \u015feklinde oldu\u011fundan elde etti\u011fimiz kay\u0131ttaki <code>veriler(2) de\u011feri bize \u015fifreyi veriyor.<br \/>\nIf sifre.Text = veriler(2).ToString Then<br \/>\nFormsAuthentication.RedirectFromLoginPage(kadi.Text, hatirla.Checked)<br \/>\nElse<br \/>\nLabel1.Visible = True<br \/>\nLabel1.Text = \"Yanl\u0131\u015f \u015fifre girdiniz\"<br \/>\nEnd If<br \/>\nLoop<br \/>\nvt.Close()<br \/>\nCatch ex As Exception<br \/>\nMsgBox(ex.Message)<br \/>\nEnd Try<\/code><br \/>\n&#8216;E\u011fer sorgu sonucunda o kullan\u0131c\u0131 ad\u0131nda kimse yok ise veriler.read olamayaca\u011f\u0131ndan i halen 0 de\u011ferine e\u015fit olacak dolay\u0131s\u0131yla<br \/>\n<code>If i = 0 Then<br \/>\nLabel1.Text = \"Kullan\u0131c\u0131 ad\u0131n\u0131 kontrol ediniz.\"<br \/>\nLabel1.Visible = True<br \/>\nEnd If<br \/>\nEnd Sub <\/code><\/p>\n<p><span style=\"color: #ffffff;\"><strong>ASP.NET kullanarak Access de\u011filde SQL server<\/strong><\/span> \u00fczerine ba\u011flant\u0131 yapmak isterseniz<br \/>\nyukar\u0131daki ba\u011flant\u0131 parametrelerini a\u015fa\u011f\u0131dakiler ile de\u011fi\u015ftirmeniz yeterli olacakt\u0131r.<br \/>\n<code>Imports System.Data<br \/>\nImports System.Data.Sql<br \/>\nImports System.Data.SqlClient<br \/>\nPartial Class Uyegirisi<br \/>\nInherits System.Web.UI.Page<br \/>\nDim vt As New SqlConnection<br \/>\nDim veriler As SqlDataReader<br \/>\nDim komut As SqlCommand<br \/>\nProtected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<\/code><br \/>\n&#8216;Kimlik do\u011frulama y\u00f6ntemi olarak windows auth kullan\u0131rsak<br \/>\n<code>vt.ConnectionString = \"Data Source=SUNUCUADI;Initial Catalog=VTADI;Integrated Security=True\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server Kullan\u0131c\u0131 kimlik do\u011frulamas\u0131 y\u00f6ntemleri &#8216;1 SQL kullan\u0131c\u0131s\u0131 kullanarak Data Source=SUNUCU;Initial Catalog=VERITABANIADI;User ID=VERITABANIKULLANICIADI;Password=SIFRE \u20182 Entegre windows kimlik do\u011frulamas\u0131 i\u00e7in Data Source=SUNUCU;Initial Catalog=VERITABANIADI;Integrated Security=True &#8216;ASP.Net \u00fczerinden Access veritaban\u0131na ba\u011flan\u0131p sorgu \u00e7al\u0131\u015ft\u0131ral\u0131m.A\u015fa\u011f\u0131daki \u00f6rnekte veritaban\u0131na ba\u011flan\u0131p kullan\u0131c\u0131 sorgulamas\u0131 yap\u0131l\u0131yor. sonuca g\u00f6re label \u00fczerine yaz\u0131 aktar\u0131l\u0131yor &#8216;K\u00fct\u00fcphanelerimizi y\u00fckleyelim Imports System.Data.OleDb Imports System.Data Partial Class Uyegirisi Inherits System.Web.UI.Page &#8216;vt &hellip; <a href=\"https:\/\/www.notsayfam.com\/?p=19\" class=\"more-link\">Okumaya devam et<span class=\"screen-reader-text\"> &#8220;Vb.net\/ASP.Net veritaban\u0131 ba\u011flant\u0131s\u0131&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13],"tags":[72,105,17,73],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-programlama","category-vb-net","tag-aspnet-ile-access-baglanti","tag-programlama","tag-vbnet","tag-visual-basic-komut-satirindan-veritabanina-baglanti"],"_links":{"self":[{"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":11,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/270"}],"wp:attachment":[{"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.notsayfam.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}