Solved

MySQL Starter Kit

Posted on 2006-07-12
12
659 Views
Last Modified: 2008-01-09
I need a Starter Kit that uses MySQL. Anyone know where to get one?

Many kind thanks in advance,

John
0
Comment
Question by:John Account
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 27

Expert Comment

by:Sammy
Comment Utility
I dont think there's such thing as MySql starter Kit for asp.net
still there are alot of places that can start you up using mysql and asp.net
http://www.aspnet101.com/aspnet101/tutorials.aspx?id=39
you can download MySQL Connector/Net from http://dev.mysql.com/downloads/connector/net/1.0.html
the driver is fully documents with lots of examples
of course theres always the connectors forums at http://forums.mysql.com/list.php?38

HTH
0
 

Author Comment

by:John Account
Comment Utility
It's just that since I'm very novice with the whole .Net Visual Studio, that a good solid sample would be very helpful to get started--especially since I don't have the luxery of using MS SQL Server and the Express edition just wont cut for me.

I'm trying to find a DotNetNuke sample that uses MySQL instead of MS SQL.

Well, thanks, Sammy. Maybe a link you provided there for me will enlighten me enough to get the grasp of things. I sure hope so!
0
 
LVL 27

Expert Comment

by:Sammy
Comment Utility
once you download the connector, just read the documentation and it will explain a lot of things.
another thing you can always do with matters like this is using google to perform searches and you will find lots of them.
take a look at the results of googling mysql asp.net
http://www.google.ca/search?q=mysql+asp.net&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official


HTH
0
 
LVL 12

Expert Comment

by:deanvanrooyen
Comment Utility
hi JohnLucio

I use the mysql connector for my database, using .net 2.0 it works fine (you just add the ddl to the project with a refernce and then you use it like the native system.data.sqlclient. I also use dotnetnuke but using it with sql express at the moment and would also like to to use a mysql data provider. it looks like a company has written one (so there is a charge) http://forums.asp.net/thread/1155784.aspx (at the bottom of the post)
it looks like you would have to write a mysql version of "AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider"

this is not impossible but would require a good knowledge of membership and roles - I think otherwise the install of dotnetnuke you could just set the connection string to mysql and it should run the install script (I have not tried it) - there might some issues with the data types so you might have to change some of the sql script,
its just a huge job!
0
 
LVL 12

Expert Comment

by:deanvanrooyen
Comment Utility
sorry there looks like a bit more work

there is a sql dataprovider, Microsoft.ApplicationBlocks.Data.dll reference so there is a lot of work to do...
this could be just a huge nightmare and require a lot of work -  way it out over just buying the provider...
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
Comment Utility
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:John Account
Comment Utility
Well...I've been steadily trying to get this thing to work, and while it works here locally, when I upload it to my dedicated server, it doesn't work. Below are the errors rendered when trying to access the page remotely and locally (from my dedicated server):

Accessing the page locally (through IE browser via remote desktop sharing):

Server Error in '/' Application.

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'connectionStrings'

Source Error:
Line 10: <configuration>
Line 11:       <appSettings/>
Line 12:       <connectionStrings>
Line 13:             <add name="tempt_videodjConnectionString1" connectionString="DATABASE=MyDatabase;DSN=myodbc;OPTION=0;PORT=0;SERVER=MyServerIP;UID=root" providerName="System.Data.Odbc"/>
Line 14:       </connectionStrings>

Source File: Blah, blah, blah the path Line: 12

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300


Accessing the page from my dedicated server remotely:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

----------###########################----------

I'm using the MyODBC connector. I've created a system dns on my local machine and on my dedicated computer.  Please advise.
0
 
LVL 12

Accepted Solution

by:
deanvanrooyen earned 500 total points
Comment Utility

Are you using the odbc driver for mysql (looks like it) - did you get it from here:
http://dev.mysql.com/downloads/connector/odbc/3.51.html

Did you test the obbc conenction in the odbc window > in system dsn get the connection and test - it should come back connection made on the server?

Have you tried the .Net connector (this is what I predominantly use, but dont worry about this yet)
http://dev.mysql.com/downloads/connector/net/1.0.html

Have you tried one of the starter kits from the thread above (I have not used these)?

Other things - what db manager do you use for mysql, does it work on the server - just making sure the mysql stuff is ok so that the problem can be narrowed down to the web site...


some more stuff on connections strings
http://weblogs.asp.net/owscott/archive/2005/08/26/423772.aspx

Another hing here that worries me is that the above articles says connection strings for asp.net 2.0 I am ussuming the <connectionString> tag is for 2.0 but your server is running .net 1.1  .... the older way was to put the string into the appsettings tag,
do you think this is the issue?
are you doing this to get the string :
string connStr = ConfigurationManager.ConnectionStrings["MainConnStr"].ConnectionString; - 2.0
or
strConnection = ConfigurationSettings.AppSettings["ConnectionString"] - 1.1

are you using visual studio 2005 and .net 2.0? then you net to load the 2.0 framework onto the server and set the web site to use 2.0 in IIS

sorry this is a lot of stuff but rather give you more stuff to try and get you looking in the right direction....
0
 

Author Comment

by:John Account
Comment Utility
The answer to your first two questions are Yes. For your 3rd question--regarding the .Net connector--it's been installed and all but I can't find where to access it to use it.
Yes I've tried starter kits, but can't get either one to work remotely. I'm beginning to think there's something wrong with my config file and not a database connection issue, because the site works fine when I preview (debug) it--CTRL 5--from the Visual Web Developer. But when I copy these files over to my dedicated server, or even to my C:\Inetpub\wwwroot folder, I get: Server Error in '/' Application.
WHOAH--I just read: "to set the web site to use 2.0 in IIS". It was set to 1.1. Now I'm getting this error message:
------------------------------
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
------------------------------

0
 
LVL 12

Expert Comment

by:deanvanrooyen
Comment Utility
I am not sure on the error, have you checked the log, when we restart our iis server something always goes haywire so be careful ebfore that step.

to use the connector -  it is a peace of cake (hopefully!)

download the connector
run the msi installer, you can register it with the global assembly doesnt really matter
it should copy the 2.0 assembly into
C:\Program Files\MySQL\MySQL Connector Net 1.0.7\bin\.NET 2.0

then all you need to do for any project that needs to use it/access mysql, is add a reference to the project and browse to the MySql.Data.dll in the above folder, the project then copies the MySql.Data.dll into a folder called Bin

then in your code add this:
using MySql.Data.MySqlClient;
using MySql.Data.Types;

and a connection to fill say a grid looks like this (you basically have access to all similiar methods simulating the system.data.odbc library, target stuff ms databases like membership and role providers, you cant do out the box thats why dotnetnuke needs customising for mysql)

            string select = "select * from accounts";
            string MySqlConnectionString = "server=localhost;user id=root; password=password;pooling=false";

            MySqlConnection accessConnection = new MySqlConnection(MySqlConnectionString);
            MySqlCommand cmd = new MySqlCommand(select, accessConnection);
            MySqlDataAdapter da = new MySqlDataAdapter();
            da.SelectCommand = cmd;
            DataTable tableComps = new DataTable();
            tableComps.Locale = System.Globalization.CultureInfo.InvariantCulture;
            da.Fill(tableComps);            
            DataGrid1.SelectedIndex = 0;
            DataGrid1.DataSource = tableComps.DefaultView;
            DataGrid1.DataBind();

things like MySqlConnection  -  you use it the same as SqlConnection,
easy enough I hope.
0
 
LVL 12

Expert Comment

by:deanvanrooyen
Comment Utility
ps grab this one for the msi
http://dev.mysql.com/downloads/connector/net/1.0.html

Windows Source and Binaries (ZIP)  1.0.7 544.5K
0
 

Author Comment

by:John Account
Comment Utility
Thanks, deanvanrooyen. I haven't tried the Connecter (from http://dev.mysql.com/downloads/connector/net/1.0.html) since I was finally able to get the myodbc driver to work as per your directions. And it's purty freakkin fast!

As things turned out, I had to select a different Application Pool in order for any asp to work on my dedicated server. I think it has something to do with all the php I'm using in my default pool. I don't know, but I'm just glad it's all working now. So thank you very much for all your help and guidance in pulling me through this successfully.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now