Monday, October 08, 2007

Godaddy Mysql Asp.Net SqlDataSource

lokalde geliştiripde server a atınca çalışan teknoloji istiyorum. ne dil kullanırsanız ne ortam olursa olsun ya versiyonu tutmaz ordan yatar ya konfigurasyonu farklıdır yada manyakdır çalışmaz :) misal godaddy de bazı yerlerde mod_rewrite çalışır aynı makinede bazı yerlerde çalışmaz.

neyse mysql kullanıyorum bir uygulamada lokalde gridview ve sqldatasourcu çalışır duruma getirmişim update delete falan mis gibi çalışıyor attım hosta hata aynen:
Unable to find the requested .Net Framework Data Provider. It may not be installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

sebep machine.config de tanımlı olmayan mysql.data.dll imizin trust meseleleri çekip çalışamaması. bide dbfactory ile ilgili konuları var ama o konuları anlamadım. neyse bu gibi bir durum nasıl çözülür.

web.config'e gereken satırlar eklenir:
<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
version numarasından çatlıyabillir kullandığınız dll in versiyonu ile değiştirin. ve bir mutlu son daha sqldatasource gridview ve mysql tatlı tatlı çalışmaya başlar o hatada kaybolur. efendim gökden 3 elma düşmüş ................

2 comments:

Unknown said...

merhabalar.mysql ile sqldatasource gridview nasıl çalıştırıyosun? ben iki haftadır uraşıyorum hala çözemedim. netdede arandım dğru dürüst bi çözüm göremedim. bu konuda bana yardım edebilir misin?

ozzy said...

mysql in .net için olan connectorunu kuruyorum sistemime
http://dev.mysql.com/downloads/connector/net/5.0.html
burdan installer'ı seç.

o zaten gereken ayarları yapıyor machine.config bilmemne işte neyse sonra asp.net projeme add refference edip mysql.data.dll i ekliyorum sonrada sqldatasource u sürükleyip bırakıyorum configure de web.config de tanımlı olan connectionstring i de seçince pat diye çalışıyor.
web.config de connectionstring örneği:
<connectionStrings>
<add name="sozlukConnectionString" connectionString="server=localhost;user id=root;Password=xxx;persist security info=True;database=sozlukcell;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>

odd string diff

 https://leetcode.com/problems/odd-string-difference/ Beats 19.92% of users with Java   class Solution { public String oddString ( S...