在Go-Daddy主机服务器上使用Asp.Net 3.5建立MySql Server连接. [英] Making Connection MySql Server with Asp.Net 3.5 on Go-Daddy Hosting Server.

查看:83
本文介绍了在Go-Daddy主机服务器上使用Asp.Net 3.5建立MySql Server连接.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好先生
我已经使用数据库MYSQL Server在asp.net 3.5框架中开发了一个小项目.
它在本地计算机上完美工作.每当我上传到Go-Daddy Server时.它不会连接托管服务器上的mysql服务器数据库.甚至我也更改了我的web.config文件.
甚至我问到Go-Daddy客户服务部时,都会被告知将项目编译为中等阶段".我将此写入我的Web配置文件.但它会在< securitypolicy>"行中显示错误.

< location allowoverride ="true">
< system.web>
< securitypolicy>
< trustlevel name ="Medium" policyfile ="web_mediumtrust.config">
< trustlevel>

即使我删除此位置,也比将它显示到web.config文件中显示DNS-Permision错误和某些版本错误还要多.我如何解决此错误.
以及如何与Go-Daddy托管服务器上的mysql服务器数据库连接.在哪里我将mysql DLL上传到Go-Daddy托管服务器中.

请帮忙.

hello sir
I have develop small project in asp.net 3.5 framework with Database MYSQL Server .
it work Perfectly in Local machine. When Ever i Upload into Go-Daddy Server . it will not connect mysql Server database on hosting server. Even i Change my web.config file.
Even i asked about Go-Daddy Customer Care then are told "Compile Project into Medium Truct". I write this into my web config file. but it gives error at "<securitypolicy> " in line.

<location allowoverride="true">
<system.web>
<securitypolicy>
<trustlevel name="Medium" policyfile="web_mediumtrust.config">
<trustlevel>

Even i Remove this Location than it Show DNS-Permision error into web.config file and some version error . how i solve this error.
and how to connect with mysql server database on Go-Daddy hosting server.And where i Upload mysql DLL into Go-Daddy hosting server.

Please Help.

推荐答案

我确切知道您的问题是因为我之前有过这个问题,实际上问题不在您的代码中,与您使用的连接有关要连接Mysql数据库,只需简单地使用ODBC连接就可以连接到数据库,这是如何进行连接的示例

I know exactly what is your problem because I had this one before, actually the problem isn''t in your code its about the connection you use for connecting your Mysql database, simply you need to use ODBC connection to connect to your database and here is an example of how to do so

<connectionstrings>
		<add name="YourConnectionStringName" connectionstring="DRIVER={MySQL ODBC 3.51 Driver};SERVER=.;PORT=3306;DATABASE=YourDatabaseName;USER=YourDatabaseUsername;PASSWORD=YourPassword;OPTION=0;" providername="System.Data.Odbc" />
 </connectionstrings>



在网站配置文件的System.web部分中,在更改以前的代码以使其与数据库一起使用时添加新代码.

注意:您可能需要更改命令才能使用ODBC连接



add the previous code while changing it to work with your database in the System.web section in your website configuration file.

NOTE: You may need to change your commands to work with the ODBC connection


这篇关于在Go-Daddy主机服务器上使用Asp.Net 3.5建立MySql Server连接.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆